2008-02-25 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-actor.c: Remove the usage of g_return_if_fail()
	from static functions: either assert or use g_warning() to check
	internal state, as g_return_if_fail() can be compiled out.

	* clutter/clutter-main.c: Ditto as above.
This commit is contained in:
Emmanuele Bassi
2008-02-25 12:24:56 +00:00
parent db5b80465a
commit bcd9a6dcec
3 changed files with 23 additions and 17 deletions

View File

@ -1182,10 +1182,17 @@ emit_event (ClutterEvent *event,
ClutterActor *actor;
gint i = 0, n_tree_events = 0;
g_return_if_fail (event->any.source != NULL);
g_return_if_fail (lock == FALSE);
if (!event->any.source)
{
g_warning ("No event source set, discarding event");
return;
}
lock = TRUE; /* Guard against reentrancy */
/* reentrancy check */
if (lock == FALSE)
return;
lock = TRUE;
/* Sorry Mr Bassi. */
if (G_UNLIKELY (event_tree == NULL))
@ -1390,10 +1397,13 @@ clutter_do_event (ClutterEvent *event)
{
actor = clutter_stage_get_key_focus (CLUTTER_STAGE (stage));
event->any.source = actor;
g_return_if_fail (actor != NULL);
if (G_UNLIKELY (actor == NULL))
{
g_warning ("No key focus set, discarding");
return;
}
}
emit_keyboard_event (event);
}
break;