Mercurial > pidgin.yaz
diff libpurple/protocols/msn/msg.c @ 31393:b4285ea42b6e
msn_message_destroy() calls msn_message_unref() if refcount>0. This is
always the case. So change all code to call msn_message_unref() directly
and change msn_message_destroy to be a private function. This should
be more clear.
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Mon, 22 Nov 2010 07:40:23 +0000 |
| parents | 2de522fa534a |
| children | 5eb2ea662d8c |
line wrap: on
line diff
--- a/libpurple/protocols/msn/msg.c Mon Nov 22 07:32:57 2010 +0000 +++ b/libpurple/protocols/msn/msg.c Mon Nov 22 07:40:23 2010 +0000 @@ -50,18 +50,16 @@ return msg; } -void +/** + * Destroys a message. + * + * @param msg The message to destroy. + */ +static void msn_message_destroy(MsnMessage *msg) { g_return_if_fail(msg != NULL); - if (msg->ref_count > 0) - { - msn_message_unref(msg); - - return; - } - if (purple_debug_is_verbose()) purple_debug_info("msn", "message destroy (%p)\n", msg); @@ -1224,7 +1222,7 @@ g_free(text); msn_switchboard_send_msg(swboard, cancel, TRUE); - msn_message_destroy(cancel); + msn_message_unref(cancel); } } else if (!strcmp(command, "CANCEL")) {
