summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47fb45d)
raw | patch | inline | side by side (parent: 47fb45d)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 22 Apr 2014 22:13:50 +0000 (00:13 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 22 Apr 2014 22:13:50 +0000 (00:13 +0200) |
This would also be cleaned up when destroying the registered user data objects
but doing so on shutdown in much cleaner.
but doing so on shutdown in much cleaner.
src/backend/collectd/unixsock.c | patch | blob | history | |
src/backend/mk-livestatus.c | patch | blob | history | |
src/backend/puppet/store-configs.c | patch | blob | history |
index 6fc2ef901176bf82c34b9b275623a7b84a0c8977..8ac829d117c85c5ccae04bba44be92da7aa13c0f 100644 (file)
static int
sdb_collectd_shutdown(__attribute__((unused)) sdb_object_t *user_data)
{
+ if (! user_data)
+ return -1;
+
+ sdb_unixsock_client_destroy(SDB_OBJ_WRAPPER(user_data)->data);
+ SDB_OBJ_WRAPPER(user_data)->data = NULL;
return 0;
} /* sdb_collectd_shutdown */
index 21c603ad497fab30db9189405ba807b874001f06..e631ae7525acee7c8426563ed51c8531f5825a0f 100644 (file)
return 0;
} /* sdb_livestatus_init */
+static int
+sdb_livestatus_shutdown(sdb_object_t *user_data)
+{
+ if (! user_data)
+ return -1;
+
+ sdb_unixsock_client_destroy(SDB_OBJ_WRAPPER(user_data)->data);
+ SDB_OBJ_WRAPPER(user_data)->data = NULL;
+ return 0;
+} /* sdb_livestatus_shutdown */
+
static int
sdb_livestatus_collect(sdb_object_t *user_data)
{
}
sdb_plugin_register_init(cb_name, sdb_livestatus_init, user_data);
+ sdb_plugin_register_shutdown(cb_name, sdb_livestatus_shutdown, user_data);
sdb_plugin_register_collector(cb_name, sdb_livestatus_collect,
/* interval */ NULL, user_data);
index 5506b0a939e984254f2c8646a7ba954a130dbc77..0f95ae51e00f22cbca9d11057eaf489b2282e9da 100644 (file)
return 0;
} /* sdb_puppet_stcfg_init */
+static int
+sdb_puppet_stcfg_shutdown(sdb_object_t *user_data)
+{
+ if (! user_data)
+ return -1;
+
+ sdb_dbi_client_destroy(SDB_OBJ_WRAPPER(user_data)->data);
+ SDB_OBJ_WRAPPER(user_data)->data = NULL;
+ return 0;
+} /* sdb_puppet_stcfg_shutdown */
+
static int
sdb_puppet_stcfg_collect(sdb_object_t *user_data)
{
}
sdb_plugin_register_init(cb_name, sdb_puppet_stcfg_init, user_data);
+ sdb_plugin_register_shutdown(cb_name, sdb_puppet_stcfg_shutdown,
+ user_data);
sdb_plugin_register_collector(cb_name, sdb_puppet_stcfg_collect,
/* interval */ NULL, user_data);