# HG changeset patch # User Mark Doliner # Date 1290411836 0 # Node ID 5eb2ea662d8c430856fd9ca435ba9ea577442455 # Parent b4285ea42b6efad66612b16a734b99654dcca129 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. diff -r b4285ea42b6e -r 5eb2ea662d8c libpurple/protocols/msn/msg.c --- 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 * diff -r b4285ea42b6e -r 5eb2ea662d8c libpurple/protocols/msn/msg.h --- a/libpurple/protocols/msn/msg.h Mon Nov 22 07:40:23 2010 +0000 +++ b/libpurple/protocols/msn/msg.h Mon Nov 22 07:43:56 2010 +0000 @@ -188,7 +188,7 @@ * * @return @a msg, or @c NULL if the new count is 0. */ -MsnMessage *msn_message_unref(MsnMessage *msg); +void msn_message_unref(MsnMessage *msg); /** * Generates the payload data of a message.