[gnome-builder] foundry: add log message for non-main-thread access



commit f8f7627d661af9a691821e9cd06f9155560ac347
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 17 15:37:34 2019 -0800

    foundry: add log message for non-main-thread access
    
    Related to #764

 src/libide/foundry/ide-foundry-compat.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/libide/foundry/ide-foundry-compat.c b/src/libide/foundry/ide-foundry-compat.c
index a0f39af42..3b903964f 100644
--- a/src/libide/foundry/ide-foundry-compat.c
+++ b/src/libide/foundry/ide-foundry-compat.c
@@ -38,6 +38,15 @@ ensure_child_typed_borrowed (IdeContext *context,
 {
   gpointer ret;
 
+  if (!IDE_IS_MAIN_THREAD ())
+    {
+      IDE_BACKTRACE;
+
+      g_error ("A plugin has attempted to access child of type %s on a thread without referencing. "
+               "This is not allowed and the application will terminate.",
+               g_type_name (child_type));
+    }
+
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (IDE_IS_CONTEXT (context));
 


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