/pidgin/main: 8dd8c949add3: Use free_conv_message as PurpleConve...

Ankit Vani a at nevitus.org
Sat Feb 22 16:06:16 EST 2014


Changeset: 8dd8c949add396c07833aff8dc8b025b9d538271
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-23 02:36 +0530
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/8dd8c949add3

Description:

Use free_conv_message as PurpleConversationMessage's GBoxed free function

diffstat:

 libpurple/conversation.c |  20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)

diffs (50 lines):

diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -912,13 +912,15 @@ PurpleConversation *purple_conversation_
 }
 
 static PurpleConversationMessage *
-purple_conversation_message_copy(PurpleConversationMessage *msg)
+copy_conv_message(PurpleConversationMessage *msg)
 {
 	PurpleConversationMessage *newmsg;
 
 	g_return_val_if_fail(msg != NULL, NULL);
 
 	newmsg  = g_new(PurpleConversationMessage, 1);
+	PURPLE_DBUS_REGISTER_POINTER(newmsg, PurpleConversationMessage);
+
 	*newmsg = *msg;
 	newmsg->who   = g_strdup(msg->who);
 	newmsg->what  = g_strdup(msg->what);
@@ -927,18 +929,6 @@ purple_conversation_message_copy(PurpleC
 	return newmsg;
 }
 
-static void
-purple_conversation_message_free(PurpleConversationMessage *msg)
-{
-	g_return_if_fail(msg != NULL);
-
-	g_free(msg->who);
-	g_free(msg->what);
-	g_free(msg->alias);
-
-	g_free(msg);
-}
-
 GType
 purple_conversation_message_get_type(void)
 {
@@ -946,8 +936,8 @@ purple_conversation_message_get_type(voi
 
 	if (type == 0) {
 		type = g_boxed_type_register_static("PurpleConversationMessage",
-				(GBoxedCopyFunc)purple_conversation_message_copy,
-				(GBoxedFreeFunc)purple_conversation_message_free);
+				(GBoxedCopyFunc)copy_conv_message,
+				(GBoxedFreeFunc)free_conv_message);
 	}
 
 	return type;



More information about the Commits mailing list