diff options
author | Ankit Vani <a@nevitus.org> | 2013-09-04 05:26:03 +0530 |
---|---|---|
committer | Ankit Vani <a@nevitus.org> | 2013-09-04 05:26:03 +0530 |
commit | 145645e8174d5a6cd0871028f40031f27fc61cf6 (patch) | |
tree | 7c00003cdb947b0b78d5af55f65a3914b1163fcd /libpurple/protocols/sametime/sametime.c | |
parent | ebc64b00ea70b057e90f26c136191a8f2170d3ec (diff) | |
download | pidgin-145645e8174d5a6cd0871028f40031f27fc61cf6.tar.gz |
Only initialize/finalize protocol class data in *_base_init/finalize for protocols.
Moved the rest to load/unload_plugin
Diffstat (limited to 'libpurple/protocols/sametime/sametime.c')
-rw-r--r-- | libpurple/protocols/sametime/sametime.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c index 82fe86ef8b..db80f3d83a 100644 --- a/libpurple/protocols/sametime/sametime.c +++ b/libpurple/protocols/sametime/sametime.c @@ -5671,24 +5671,6 @@ mw_protocol_base_init(mwProtocolClass *klass) proto_class->protocol_options = l; l = NULL; - - /* forward all our g_log messages to purple. Generally all the logging - calls are using purple_log directly, but the g_return macros will - get caught here */ - log_handler[0] = g_log_set_handler(G_LOG_DOMAIN, logflags, - mw_log_handler, NULL); - - /* redirect meanwhile's logging to purple's */ - log_handler[1] = g_log_set_handler("meanwhile", logflags, - mw_log_handler, NULL); -} - - -static void -mw_protocol_base_finalize(mwProtocolClass *klass) -{ - g_log_remove_handler(G_LOG_DOMAIN, log_handler[0]); - g_log_remove_handler("meanwhile", log_handler[1]); } @@ -5740,6 +5722,9 @@ mw_protocol_interface_init(PurpleProtocolInterface *iface) } +static void mw_protocol_base_finalize(mwProtocolClass *klass) { } + + static PurplePluginInfo * plugin_query(GError **error) { @@ -5769,6 +5754,16 @@ plugin_load(PurplePlugin *plugin, GError **error) if (!my_protocol) return FALSE; + /* forward all our g_log messages to purple. Generally all the logging + calls are using purple_log directly, but the g_return macros will + get caught here */ + log_handler[0] = g_log_set_handler(G_LOG_DOMAIN, logflags, + mw_log_handler, NULL); + + /* redirect meanwhile's logging to purple's */ + log_handler[1] = g_log_set_handler("meanwhile", logflags, + mw_log_handler, NULL); + return TRUE; } @@ -5776,6 +5771,9 @@ plugin_load(PurplePlugin *plugin, GError **error) static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { + g_log_remove_handler(G_LOG_DOMAIN, log_handler[0]); + g_log_remove_handler("meanwhile", log_handler[1]); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; |