[Cogl] [PATCH] Log a fatal error when an error is propagated to a NULL error argument
Robert Bragg
robert at sixbynine.org
Wed Jun 26 14:09:19 PDT 2013
This looks good to land to me:
Reviewed-by: Robert Bragg <robert at linux.intel.com>
thanks,
- Robert
On Wed, Jun 26, 2013 at 5:11 PM, Neil Roberts <neil at linux.intel.com> wrote:
> 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.
> ---
> cogl/cogl-error.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/cogl/cogl-error.c b/cogl/cogl-error.c
> index 753e4c8..f72415b 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
> --
> 1.7.11.3.g3c3efa5
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
More information about the Cogl
mailing list