[gjs: 2/6] gjs_callback_closure: Use g_error, not exit, on uncatchable exceptions



commit 0fe8f6cb1493a1ba32ed883868c10bfd90549ac3
Author: Simon McVittie <smcv debian org>
Date:   Fri Jan 26 09:46:51 2018 +0000

    gjs_callback_closure: Use g_error, not exit, on uncatchable exceptions
    
    Shared libraries shouldn't exit unless application code has explicitly
    requested it; if something has gone horribly wrong, we should abort
    instead. This way we'll leave a crash dump.
    
    Signed-off-by: Simon McVittie <smcv debian org>

 gi/function.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gi/function.cpp b/gi/function.cpp
index 2f621f2a..21699b8d 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -416,9 +416,8 @@ out:
                 exit(code);
 
             /* Some other uncatchable exception, e.g. out of memory */
-            g_critical("Function %s terminated with uncatchable exception",
-                       g_base_info_get_name(trampoline->info));
-            exit(1);
+            g_error("Function %s terminated with uncatchable exception",
+                    g_base_info_get_name(trampoline->info));
         }
 
         /* Fill in the result with some hopefully neutral value */


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