diff --git a/src/core/plugin.c b/src/core/plugin.c
index 18ea82c77fc8475d73dfb9e4a37b8a7a693443fc..e67f814ba24510ae47b2640bddfa17dacea3c76f 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
if (! plugin_ctx_key_initialized)
ctx_key_init();
+ sdb_object_ref(SDB_OBJ(ctx));
pthread_setspecific(plugin_ctx_key, ctx);
return ctx;
} /* ctx_create */
ctx_key_init();
old = pthread_getspecific(plugin_ctx_key);
+ if (old)
+ sdb_object_deref(SDB_OBJ(old));
+ if (new)
+ sdb_object_ref(SDB_OBJ(new));
pthread_setspecific(plugin_ctx_key, new);
return old;
} /* ctx_set */