Summary:ASTERISK-03121: [PATCH] ASTOBJ API correction
Reporter:Kevin P. Fleming (kpfleming)Labels:
Date Opened:2004-12-29 00:22:52.000-0600Date Closed:2008-01-15 15:18:36.000-0600
Versions:Frequency of
Environment:Attachments:( 0) astobj_container_ref_fix_rev1.diff.txt
( 1) astobj_container_ref_fix_rev2.diff.txt
Description:(ooh, the bad karma has been haunting me all day)

Part of the API change that went into CVS today was borked... the container _should_ have a REF on each object in the list. Otherwise objects in the list have a zero refcount, and are subject to destruction if the wrong sequence of events occurs. Also, during TRAVERSE, the "eval" block can't rely on the object staying around unless it REFs the object itself, which should not be necessary (it can "borrow" the container's REF).

This patch restores ASTOBJ_REF being called during LINK, and removes ASTOBJ_REF being called during UNLINK (which means the caller of UNLINK _must_ capture the returned object pointer and UNREF it later). It also adds UNREF during DESTROY_ALL, so that the container's REFs on all its objects will be removed.


Disclaimer is on file
Comments:By: Kevin P. Fleming (kpfleming) 2004-12-29 00:27:28.000-0600

And this time with a version that actually compiles...

By: Mark Spencer (markster) 2004-12-29 02:55:34.000-0600

Fixed in CVS head, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:18:36.000-0600

Repository: asterisk
Revision: 4582

U   trunk/include/asterisk/astobj.h

r4582 | markster | 2008-01-15 15:18:36 -0600 (Tue, 15 Jan 2008) | 2 lines

Merge remainder of kpfleming's astobj patch (bug ASTERISK-3121)