[gnome-builder] libide/code: add assertion for main thread



commit cf405385152895eb764082efd28383065866b1d5
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 19 14:30:16 2022 -0700

    libide/code: add assertion for main thread

 src/libide/code/ide-symbol.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/libide/code/ide-symbol.c b/src/libide/code/ide-symbol.c
index a7df53a9e..56ecaa7cc 100644
--- a/src/libide/code/ide-symbol.c
+++ b/src/libide/code/ide-symbol.c
@@ -422,6 +422,8 @@ ide_symbol_kind_get_icon_name (IdeSymbolKind kind)
  *
  * Gets a #GIcon to represent the symbol kind.
  *
+ * You may only call this from the main (GTK) thread.
+ *
  * Returns: (transfer none) (nullable): a #GIcon or %NULL
  */
 GIcon *
@@ -430,6 +432,8 @@ ide_symbol_kind_get_gicon (IdeSymbolKind kind)
   const char *icon_name;
   GIcon *ret = NULL;
 
+  g_assert (IDE_IS_MAIN_THREAD ());
+
   if ((icon_name = ide_symbol_kind_get_icon_name (kind)))
     {
       static GHashTable *cached;


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