[gimp-perl] Errors are fatal and reported right. Bug #726084



commit f99eec7ff8eb9c7e32c84f848a4f52f14a20f8ce
Author: Ed J <m8r-35s8eo mailinator com>
Date:   Tue Mar 11 04:02:26 2014 +0000

    Errors are fatal and reported right. Bug #726084

 Gimp/Lib.xs |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/Gimp/Lib.xs b/Gimp/Lib.xs
index 851ed6d..9c00f2d 100644
--- a/Gimp/Lib.xs
+++ b/Gimp/Lib.xs
@@ -197,6 +197,13 @@ static void trace_printf (char *frmt, ...)
 
 #endif
 
+void throw_exception(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer 
user_data)
+{
+  char buffer[MAX_STRING];
+  snprintf (buffer, sizeof buffer, "%s: %s", log_domain, message);
+  croak(buffer);
+}
+
 /* new SV with len len.  There _must_ be a better way, but newSV doesn't work.  */
 static SV *newSVn (STRLEN len)
 {
@@ -2205,6 +2212,12 @@ gimp_pixel_rgn_data(...)
 
 BOOT:
        trace_file = PerlIO_stderr ();
+       g_log_set_handler(
+         "LibGimp",
+         G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
+         throw_exception,
+         NULL
+       );
 
 #
 # this function overrides a pdb function for speed


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]