[gtk] profiling: Avoid criticals



commit 376f5eacbd7b0ce2e69ada9a6e577bb9b6040545
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 21 07:23:40 2020 -0500

    profiling: Avoid criticals
    
    With events no longer GObjects, the type class is
    longer around for peeking.

 gdk/gdksurface.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 6974e7ec76..0d326e3dfd 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -4035,11 +4035,14 @@ add_event_mark (GdkEvent *event,
 {
   gchar *message = NULL;
   const gchar *kind;
+  GEnumClass *class;
   GEnumValue *value;
   GdkEventType event_type;
 
   event_type = gdk_event_get_event_type (event);
-  value = g_enum_get_value (g_type_class_peek_static (GDK_TYPE_EVENT_TYPE), event_type);
+  class = g_type_class_ref (GDK_TYPE_EVENT_TYPE);
+  value = g_enum_get_value (class, event_type);
+  g_type_class_unref (class);
   kind = value ? value->value_nick : NULL;
 
   switch (event_type)


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