libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit ecff3e563688a7736b19d2ef72db598a34eee0d0
parent 2399e68f28366c91a3d7093bb2c81c7d5818513f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 30 Jul 2012 13:06:01 +0000

add reference counting for shm and destroy them when they are finished

Diffstat:
Msrc/main/extractor_plugins.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/extractor_plugins.c b/src/main/extractor_plugins.c @@ -381,7 +381,8 @@ EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, prev->next = pos->next; if (NULL != pos->channel) EXTRACTOR_IPC_channel_destroy_ (pos->channel); - if (0 == EXTRACTOR_IPC_shared_memory_change_rc_ (pos->shm, -1)) + if ( (NULL != pos->shm) && + (0 == EXTRACTOR_IPC_shared_memory_change_rc_ (pos->shm, -1)) ) EXTRACTOR_IPC_shared_memory_destroy_ (pos->shm); free (pos->short_libname); free (pos->libname);