[gtk: 22/40] icon-theme: Only add theme load profiler mark if we actually load theme



commit 55db9d07c53acbe01a9fc1e2013682e895ebcb28
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Jan 28 17:08:52 2020 +0100

    icon-theme: Only add theme load profiler mark if we actually load theme

 gtk/gtkicontheme.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 3b15af972d..3822b9b69b 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -1735,7 +1735,6 @@ ensure_valid_themes (GtkIconTheme *self,
 {
   GTimeVal tv;
   gboolean was_valid = self->themes_valid;
-  gint64 before = g_get_monotonic_time ();
 
   if (self->themes_valid)
     {
@@ -1756,18 +1755,21 @@ ensure_valid_themes (GtkIconTheme *self,
 
   if (!self->themes_valid)
     {
+      gint64 before;
       if (non_blocking)
         return FALSE;
 
+       before = g_get_monotonic_time ();
+
       load_themes (self);
 
+      if (gdk_profiler_is_running ())
+        gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", 
NULL);
+
       if (was_valid)
         queue_theme_changed (self);
     }
 
-  if (gdk_profiler_is_running ())
-    gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", 
NULL);
-
   return TRUE;
 }
 


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