Age | Commit message (Collapse) | Author |
|
Implement grab/drop functions to increase/decrease reference count
and destroy the object if the count drops to 0.
Make sure that all objects that maintain internal references actually
grab that reference, duplicate it in the copy function, drop it in
the destroy handler.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Many library destructor functions (like free()) allow a NULL
pointer as input, and do nothing in that case.
This allows easier cleanup patterns: initialize pointers to NULL
and then always pass them to the destroyer functions, no need for
verbose goto/if-else patterns.
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
|
|
On the 1.1.x branch, the upstream "allow delete if NULL" patch is not
applied, so this needs an explcit fix.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Licensed under 0BSD: https://opensource.org/licenses/0BSD
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
|