[gimp/gimp-2-10] app: NULL log domain is not a bug.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: NULL log domain is not a bug.
- Date: Thu, 24 Sep 2020 21:14:13 +0000 (UTC)
commit 171ec7c24f4b183cc77b7ac9e7223a07fa18d5f9
Author: Jehan <jehan girinstud io>
Date: Tue Sep 22 17:52:32 2020 +0200
app: NULL log domain is not a bug.
A log error can have a NULL domain (apparently equivalent to "" default
domain, according to g_log_set_handler() docs and we even explicitly
list the NULL domain in the log_domains array in app/gimp-log.c.
Yet our log handler was not expecting such possibility and was running a
g_str_has_prefix() on NULL. Not sure why it aborted there. It might be
because outputting a new warning inside the warning handler did not go
well. Anyway this seems to fix our side of the bug #5358. The main fix
will likely be on GEGL side (UMFPACK_ERROR_out_of_memory error).
(cherry picked from commit 5fb057776847c576c94484bd431b87793c66f040)
app/errors.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/app/errors.c b/app/errors.c
index 42538e9e37..5baea9f39a 100644
--- a/app/errors.c
+++ b/app/errors.c
@@ -227,8 +227,9 @@ gimp_message_log_func (const gchar *log_domain,
* we need to keep the log domain information for third party
* messages.
*/
- if (! g_str_has_prefix (log_domain, "Gimp") &&
- ! g_str_has_prefix (log_domain, "LibGimp"))
+ if (! log_domain ||
+ (! g_str_has_prefix (log_domain, "Gimp") &&
+ ! g_str_has_prefix (log_domain, "LibGimp")))
msg_domain = log_domain;
/* If debug policy requires it, WARNING and CRITICAL errors must be
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]