diff src/conversation.c @ 11146:1c5398ccbeb0

[gaim-migrate @ 13217] Gaim-DBUS signal export works with DBUS >= 0.35 Various gaim API functions available through DBUS committer: Tailor Script <tailor@pidgin.im>
author Piotr Zielinski <zielaj>
date Fri, 22 Jul 2005 19:47:29 +0000
parents 096020ae09a9
children ebb02ea3c789
line wrap: on
line diff
--- a/src/conversation.c	Fri Jul 22 07:11:08 2005 +0000
+++ b/src/conversation.c	Fri Jul 22 19:47:29 2005 +0000
@@ -22,6 +22,7 @@
 #include "internal.h"
 #include "blist.h"
 #include "conversation.h"
+#include "dbus-maybe.h"
 #include "debug.h"
 #include "imgstore.h"
 #include "notify.h"
@@ -266,6 +267,7 @@
 	GaimConvWindow *win;
 
 	win = g_new0(GaimConvWindow, 1);
+	GAIM_DBUS_REGISTER_POINTER(win, GaimConvWindow);
 
 	windows = g_list_append(windows, win);
 
@@ -318,6 +320,7 @@
 
 		windows = g_list_remove(windows, win);
 
+		GAIM_DBUS_UNREGISTER_POINTER(win);
 		g_free(win);
 	}
 }
@@ -672,6 +675,7 @@
 	g_return_val_if_fail(gc != NULL, NULL);
 
 	conv = g_new0(GaimConversation, 1);
+	GAIM_DBUS_REGISTER_POINTER(conv, GaimConversation);
 
 	conv->type         = type;
 	conv->account      = account;
@@ -692,6 +696,7 @@
 		GaimBuddyIcon *icon;
 		conv->u.im = g_new0(GaimConvIm, 1);
 		conv->u.im->conv = conv;
+		GAIM_DBUS_REGISTER_POINTER(conv->u.im, GaimConvIm);
 
 		ims = g_list_append(ims, conv);
 		if ((icon = gaim_buddy_icons_find(account, name)))
@@ -706,6 +711,7 @@
 
 		conv->u.chat = g_new0(GaimConvChat, 1);
 		conv->u.chat->conv = conv;
+		GAIM_DBUS_REGISTER_POINTER(conv->u.chat, GaimConvChat);
 
 		chats = g_list_append(chats, conv);
 
@@ -905,6 +911,7 @@
 		if(conv->u.chat->nick)
 			g_free(conv->u.chat->nick);
 
+		GAIM_DBUS_UNREGISTER_POINTER(conv->u.chat);
 		g_free(conv->u.chat);
 		conv->u.chat = NULL;
 
@@ -922,6 +929,7 @@
 		ops->destroy_conversation(conv);
 
 	gaim_log_free(conv->log);
+	GAIM_DBUS_UNREGISTER_POINTER(conv);
 	g_free(conv);
 	conv = NULL;
 }
@@ -2338,6 +2346,7 @@
 	cb->name = g_strdup(name);
 	cb->flags = flags;
 
+	GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy);
 	return cb;
 }
 
@@ -2368,6 +2377,8 @@
 		g_free(cb->name);
 	cb->name = NULL;
 	cb->flags = 0;
+
+	GAIM_DBUS_UNREGISTER_POINTER(cb);
 	g_free(cb);
 }