<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9875">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_odbc: Allow unload at shutdown.<br><br>This makes it possible for REF_DEBUG to report no leaks when loading<br>res_odbc.<br><br>Change-Id: I1a3dea786bd6e7f4820a6dd5cbaa197fa783ce93<br>---<br>M res/res_odbc.c<br>1 file changed, 12 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/75/9875/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_odbc.c b/res/res_odbc.c</span><br><span>index 3ee8cba..b4c1585 100644</span><br><span>--- a/res/res_odbc.c</span><br><span>+++ b/res/res_odbc.c</span><br><span>@@ -996,17 +996,25 @@</span><br><span> </span><br><span> static int unload_module(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- /* Prohibit unloading */</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(class_container);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli_unregister_multiple(cli_odbc, ARRAY_LEN(cli_odbc));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span> }</span><br><span> </span><br><span> static int load_module(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(class_container = ao2_container_alloc(1, null_hash_fn, ao2_match_by_addr)))</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!(class_container = ao2_container_alloc(1, null_hash_fn, ao2_match_by_addr))) {</span><br><span> return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(0, 100%, 40%);">- if (load_odbc_config() == -1)</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (load_odbc_config() == -1) {</span><br><span> return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_module_shutdown_ref(ast_module_info->self);</span><br><span> ast_cli_register_multiple(cli_odbc, ARRAY_LEN(cli_odbc));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> return AST_MODULE_LOAD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9875">change 9875</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9875"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I1a3dea786bd6e7f4820a6dd5cbaa197fa783ce93 </div>
<div style="display:none"> Gerrit-Change-Number: 9875 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>