Call message_handlers_clear() upon disconnect
Free pubsub_event_handlers. Fix memory leaks.
This commit is contained in:
@@ -178,6 +178,14 @@ message_handlers_init(void)
|
||||
pubsub_event_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
|
||||
}
|
||||
|
||||
void
|
||||
message_handlers_clear(void)
|
||||
{
|
||||
if (pubsub_event_handlers) {
|
||||
g_hash_table_remove_all(pubsub_event_handlers);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
message_pubsub_event_handler_add(const char *const node, ProfMessageCallback func, ProfMessageFreeCallback free_func, void *userdata)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user