From: Sebastian Harl Date: Wed, 9 Jul 2014 19:33:27 +0000 (+0200) Subject: object: Static wrapper objects cannot have a destructor. X-Git-Tag: sysdb-0.3.0~63 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7225d9693ff41cbb4f8ab4766e95ddf50bc1811c;p=sysdb.git object: Static wrapper objects cannot have a destructor. We cannot free the static memory and, thus, cannot destroy the object. --- diff --git a/src/backend/collectd/unixsock.c b/src/backend/collectd/unixsock.c index 7145e9d..b8bbbfe 100644 --- a/src/backend/collectd/unixsock.c +++ b/src/backend/collectd/unixsock.c @@ -261,8 +261,7 @@ sdb_collectd_collect(sdb_object_t *user_data) long int count; sdb_collectd_state_t state = SDB_COLLECTD_STATE_INIT; - sdb_object_wrapper_t state_obj = SDB_OBJECT_WRAPPER_STATIC(&state, - /* destructor = */ NULL); + sdb_object_wrapper_t state_obj = SDB_OBJECT_WRAPPER_STATIC(&state); if (! user_data) return -1; diff --git a/src/include/core/object.h b/src/include/core/object.h index 42352b0..a92fb53 100644 --- a/src/include/core/object.h +++ b/src/include/core/object.h @@ -133,8 +133,8 @@ sdb_object_t * sdb_object_create_wrapper(const char *name, void *data, void (*destructor)(void *)); -#define SDB_OBJECT_WRAPPER_STATIC(obj, destructor) \ - { SDB_OBJECT_INIT, (obj), (destructor) } +#define SDB_OBJECT_WRAPPER_STATIC(obj) \ + { SDB_OBJECT_INIT, (obj), /* destructor */ NULL } /* * sdb_object_deref: