diff libpurple/protocols/msn/msg.c @ 30953:5eb2ea662d8c

Nothing uses this return value, so stop returning it. I think it's weird for an unref function to return a pointer to the object you unreffed. I see how there could be an argument for such a thing... but it seems like it would be better to write code that doesn't require knowing whether the object you unreffed was destroyed.
author Mark Doliner <mark@kingant.net>
date Mon, 22 Nov 2010 07:43:56 +0000
parents b4285ea42b6e
children 61db10475bed
line wrap: on
line diff
--- a/libpurple/protocols/msn/msg.c	Mon Nov 22 07:40:23 2010 +0000
+++ b/libpurple/protocols/msn/msg.c	Mon Nov 22 07:43:56 2010 +0000
@@ -88,11 +88,11 @@
 	return msg;
 }
 
-MsnMessage *
+void
 msn_message_unref(MsnMessage *msg)
 {
-	g_return_val_if_fail(msg != NULL, NULL);
-	g_return_val_if_fail(msg->ref_count > 0, NULL);
+	g_return_if_fail(msg != NULL);
+	g_return_if_fail(msg->ref_count > 0);
 
 	msg->ref_count--;
 
@@ -100,13 +100,7 @@
 		purple_debug_info("msn", "message unref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count);
 
 	if (msg->ref_count == 0)
-	{
 		msn_message_destroy(msg);
-
-		return NULL;
-	}
-
-	return msg;
 }
 
 MsnMessage *