/soc/2013/ankitkv/gobjectification: 70791ae6137b: Unregister the...

Ankit Vani a at nevitus.org
Mon Aug 5 17:42:39 EDT 2013


Changeset: 70791ae6137bd85e8205c730435e9a0fee713a21
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-06 03:12 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/70791ae6137b

Description:

Unregister the command when plugin is unloaded

diffstat:

 libpurple/protocols/null/nullprpl.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (29 lines):

diff --git a/libpurple/protocols/null/nullprpl.c b/libpurple/protocols/null/nullprpl.c
--- a/libpurple/protocols/null/nullprpl.c
+++ b/libpurple/protocols/null/nullprpl.c
@@ -69,6 +69,7 @@
 
 #define NULLPRPL_ID "prpl-null"
 static PurplePluginProtocolInfo *_null_protocol = NULL;
+static PurpleCmdId msg_cmd;
 
 #define NULL_STATUS_ONLINE   "online"
 #define NULL_STATUS_AWAY     "away"
@@ -1168,7 +1169,7 @@ gplugin_plugin_load(PurplePlugin *plugin
   prpl_info.protocol_options = g_list_append(NULL, option);
 
   /* register whisper chat command, /msg */
-  purple_cmd_register("msg",
+  msg_cmd = purple_cmd_register("msg",
                     "ws",                  /* args: recipient and message */
                     PURPLE_CMD_P_DEFAULT,  /* priority */
                     PURPLE_CMD_FLAG_CHAT,
@@ -1196,6 +1197,8 @@ gplugin_plugin_unload(PurplePlugin *plug
 {
   purple_debug_info("nullprpl", "shutting down\n");
 
+  purple_cmd_unregister(msg_cmd);
   purple_protocols_remove(_null_protocol);
+
   return TRUE;
 }



More information about the Commits mailing list