]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_smdi.c: Fix module ref counting and inverted test.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 2 Oct 2018 21:15:37 +0000 (16:15 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 2 Oct 2018 23:18:36 +0000 (18:18 -0500)
commitd55ded340fcd0d19d87fff5e62df88a0f0308950
tree42633e5f191c8816448d734660d2a3bb4c2a8edd
parentec52409a530d9cdbee2e6524d460ab8b27f25d24
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
res/res_smdi.c