# HG changeset patch # User Yoshiki Yazawa # Date 1222939581 -32400 # Node ID 9e37b72309d46ff26c7b78dd071a91875612f4af # Parent b88a5f93422494366799741ead4d878bd9b3387d - clear current song if audacious is not playing. - disconnect from dbus when unload this plugin. diff -r b88a5f934224 -r 9e37b72309d4 pidgin-audacious.c --- a/pidgin-audacious.c Thu Oct 02 17:12:04 2008 +0900 +++ b/pidgin-audacious.c Thu Oct 02 18:26:21 2008 +0900 @@ -63,6 +63,7 @@ GHashTable *pushed_userinfo; GHashTable *pushed_alias; +DBusGConnection *connection = NULL; DBusGProxy *session = NULL; static PurpleCmdId cmdid_paste_current_song; @@ -72,8 +73,6 @@ static DBusGProxy * get_dbus_proxy(void) { - DBusGConnection *connection = NULL; - DBusGProxy *session = NULL; GError *error = NULL; connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); g_clear_error(&error); @@ -104,6 +103,7 @@ if(!audacious_remote_is_playing(session)) { /* audacious isn't playing */ aud_process(NULL); + purple_util_set_current_song(NULL, NULL, NULL); return rv; } @@ -561,6 +561,11 @@ g_object_unref(session); session = NULL; + if(connection) { + dbus_g_connection_unref(connection); + connection = NULL; + } + return TRUE; }