From ad83caaed16a36aea0fafd4ed87cc283c30c413b Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 5 Oct 2009 12:34:48 +0100 Subject: [PATCH] Clarify the IdPool warning Instead of having an assertion failure with a message of dubious usefulness, we should probably use a more verbose warning explaining what is the problem and what might be the cause. --- clutter/clutter-id-pool.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-id-pool.c b/clutter/clutter-id-pool.c index b383e4bfd..53c7c6711 100644 --- a/clutter/clutter-id-pool.c +++ b/clutter/clutter-id-pool.c @@ -115,7 +115,14 @@ clutter_id_pool_lookup (ClutterIDPool *id_pool, g_return_val_if_fail (id_pool != NULL, NULL); g_return_val_if_fail (id_pool->array != NULL, NULL); - g_return_val_if_fail (id < id_pool->array->len, NULL); + if (id > id_pool->array->len) + { + g_warning ("The required ID of %u is outside the ID range; this " + "usually implies that the pick() of an actor is not " + "correctly implemented or that there is an error in the " + "glReadPixels() implementation of the GL driver.", id); + return NULL; + } array = (void*) id_pool->array->data;