[Asterisk-code-review] res smdi.c: Fix module ref counting and inverted test. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Oct 3 11:41:57 CDT 2018


Hello Jenkins2, George Joseph, Corey Farrell, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/10382

to look at the new patch set (#3).

Change subject: res_smdi.c: Fix module ref counting and inverted test.
......................................................................

res_smdi.c: Fix module ref counting and inverted test.

I think this module is so screwed up that it doesn't work anymore.  Even
with these attempts to fix things it still won't gracefully shut down.
The module refs will not go to zero to allow unloading the module.

* Fix module ref counting dealing with the SMDI interface object.  There
were several off-nominal paths that unbalanced the module ref count.  Also
the destructor freed the ao2 object itself which is bad.  Made the
smdi_read thread not hold its own ref to the SMDI interface object so when
all refs go away the destructor will stop the listener thread.

* Fixed the smdi_load() return code of 1 concerning the number of
listeners.  The test was inverted.

Change-Id: Ic288db51b58e395d6a2fc3847f77176c16988784
---
M res/res_smdi.c
1 file changed, 18 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/10382/3
-- 
To view, visit https://gerrit.asterisk.org/10382
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic288db51b58e395d6a2fc3847f77176c16988784
Gerrit-Change-Number: 10382
Gerrit-PatchSet: 3
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181003/f6f824cc/attachment.html>


More information about the asterisk-code-review mailing list