[glib] notify: Emit a g_critical() instead g_return_if_fail()ing
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] notify: Emit a g_critical() instead g_return_if_fail()ing
- Date: Thu, 22 Jul 2010 20:00:49 +0000 (UTC)
commit a2c5bba31d19dcd7f3726c99280ff794cbf744a9
Author: Benjamin Otte <otte redhat com>
Date: Thu Jul 22 08:52:25 2010 +0200
notify: Emit a g_critical() instead g_return_if_fail()ing
This does not change the code semantically in any way but avoids a
return in the middle of the code.
https://bugzilla.gnome.org/show_bug.cgi?id=166020
gobject/gobjectnotifyqueue.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gobject/gobjectnotifyqueue.c b/gobject/gobjectnotifyqueue.c
index 56422c2..0fddf6f 100644
--- a/gobject/gobjectnotifyqueue.c
+++ b/gobject/gobjectnotifyqueue.c
@@ -75,8 +75,13 @@ g_object_notify_queue_freeze (GObject *object,
nqueue, g_object_notify_queue_free);
}
- g_return_val_if_fail (nqueue->freeze_count < 65535, nqueue);
- nqueue->freeze_count++;
+ if (nqueue->freeze_count >= 65535)
+ g_critical("Free queue for %s (%p) is larger than 65535,"
+ " called g_object_freeze_notify() too often."
+ " Forgot to call g_object_thaw_notify() or infinite loop",
+ G_OBJECT_TYPE_NAME (object), object);
+ else
+ nqueue->freeze_count++;
return nqueue;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]