changeset 12250:5e2a365af01b

[gaim-migrate @ 14552] Change some *_unref() reference count guards into g_return_if_fail()/g_return_val_if_fail(). That way we'll get a debug message if they fail, not that they ever should, of course. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 28 Nov 2005 11:47:50 +0000
parents 064a2c28ceec
children 1ec49f3360d2
files src/buddyicon.c src/ft.c src/protocols/msn/command.c src/protocols/msn/msg.c src/roomlist.c
diffstat 5 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddyicon.c	Mon Nov 28 06:55:42 2005 +0000
+++ b/src/buddyicon.c	Mon Nov 28 11:47:50 2005 +0000
@@ -153,9 +153,7 @@
 gaim_buddy_icon_unref(GaimBuddyIcon *icon)
 {
 	g_return_val_if_fail(icon != NULL, NULL);
-
-	if (icon->ref_count <= 0)
-		return NULL;
+	g_return_val_if_fail(icon->ref_count > 0, NULL);
 
 	icon->ref_count--;
 
--- a/src/ft.c	Mon Nov 28 06:55:42 2005 +0000
+++ b/src/ft.c	Mon Nov 28 11:47:50 2005 +0000
@@ -98,6 +98,7 @@
 gaim_xfer_unref(GaimXfer *xfer)
 {
 	g_return_if_fail(xfer != NULL);
+	g_return_if_fail(xfer->ref > 0);
 
 	xfer->ref--;
 
--- a/src/protocols/msn/command.c	Mon Nov 28 06:55:42 2005 +0000
+++ b/src/protocols/msn/command.c	Mon Nov 28 11:47:50 2005 +0000
@@ -106,9 +106,7 @@
 msn_command_unref(MsnCommand *cmd)
 {
 	g_return_val_if_fail(cmd != NULL, NULL);
-
-	if (cmd->ref_count <= 0)
-		return NULL;
+	g_return_val_if_fail(cmd->ref_count > 0, NULL);
 
 	cmd->ref_count--;
 
--- a/src/protocols/msn/msg.c	Mon Nov 28 06:55:42 2005 +0000
+++ b/src/protocols/msn/msg.c	Mon Nov 28 11:47:50 2005 +0000
@@ -96,9 +96,7 @@
 msn_message_unref(MsnMessage *msg)
 {
 	g_return_val_if_fail(msg != NULL, NULL);
-
-	if (msg->ref_count <= 0)
-		return NULL;
+	g_return_val_if_fail(msg->ref_count > 0, NULL);
 
 	msg->ref_count--;
 
--- a/src/roomlist.c	Mon Nov 28 06:55:42 2005 +0000
+++ b/src/roomlist.c	Mon Nov 28 11:47:50 2005 +0000
@@ -124,6 +124,7 @@
 void gaim_roomlist_unref(GaimRoomlist *list)
 {
 	g_return_if_fail(list != NULL);
+	g_return_if_fail(list->ref > 0);
 
 	list->ref--;