summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-06-26 17:07:34 +0100
committerNeil Roberts <neil@linux.intel.com>2013-06-27 14:30:39 +0100
commitbf1596f41b86559c60a5f8b68a252afa41a2e97b (patch)
tree111601c413324aa3fbcb7ec4b59b6e39c6a539af
parent4061a7b7ad1729c18af8b8b2745c82c6872b8f1a (diff)
downloadcogl-bf1596f41b86559c60a5f8b68a252afa41a2e97b.tar.gz
Log a fatal error when an error is propagated to a NULL error argument
Unlike in GError, the policy in Cogl for when NULL is passed as the CoglError argument is that the program should abort with a fatal error. Previously however any errors that were being propagated were being silently dropped if the application passed NULL. This patch fixes it to also log a fatal error in that case. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 41e233b4b27de579f77b82115cf43a618bf0c93f)
-rw-r--r--cogl/cogl-error.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cogl/cogl-error.c b/cogl/cogl-error.c
index 753e4c82..f72415bd 100644
--- a/cogl/cogl-error.c
+++ b/cogl/cogl-error.c
@@ -105,7 +105,10 @@ _cogl_propagate_error (CoglError **dest,
_COGL_RETURN_IF_FAIL (src != NULL);
if (dest == NULL)
- cogl_error_free (src);
+ {
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "%s", src->message);
+ cogl_error_free (src);
+ }
else if (*dest)
g_warning (ERROR_OVERWRITTEN_WARNING, src->message);
else