[sysprof] window: reset profiler after capture



commit 9ba08c8d9380cbf62a3f0393ad8e6c07b15cbf89
Author: Christian Hergert <christian hergert me>
Date:   Thu Apr 14 16:20:32 2016 -0700

    window: reset profiler after capture
    
    We don't really want to reuse SpProfiler instances after running, so when
    we transition to browsing, reset the profiler instance.

 src/sp-window.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/sp-window.c b/src/sp-window.c
index d175eb8..36c0e8f 100644
--- a/src/sp-window.c
+++ b/src/sp-window.c
@@ -265,8 +265,6 @@ sp_window_set_state (SpWindow      *self,
     {
     case SP_WINDOW_STATE_EMPTY:
     case SP_WINDOW_STATE_FAILED:
-      profiler = sp_local_profiler_new ();
-
       gtk_button_set_label (self->record_button, _("Record"));
       gtk_widget_set_sensitive (GTK_WIDGET (self->record_button), TRUE);
       add_class (self->record_button, "suggsted-action");
@@ -279,10 +277,11 @@ sp_window_set_state (SpWindow      *self,
       sp_callgraph_view_set_profile (self->callgraph_view, NULL);
       gtk_widget_set_visible (GTK_WIDGET (self->stat_label), FALSE);
       g_clear_pointer (&self->reader, sp_capture_reader_unref);
-      sp_window_set_profiler (self, profiler);
       sp_window_action_set (self, "close-capture", "enabled", FALSE, NULL);
       sp_window_action_set (self, "save-capture", "enabled", FALSE, NULL);
       sp_window_action_set (self, "screenshot", "enabled", FALSE, NULL);
+      profiler = sp_local_profiler_new ();
+      sp_window_set_profiler (self, profiler);
       break;
 
     case SP_WINDOW_STATE_RECORDING:
@@ -321,7 +320,8 @@ sp_window_set_state (SpWindow      *self,
       sp_window_action_set (self, "close-capture", "enabled", TRUE, NULL);
       sp_window_action_set (self, "save-capture", "enabled", TRUE, NULL);
       sp_window_action_set (self, "screenshot", "enabled", TRUE, NULL);
-
+      profiler = sp_local_profiler_new ();
+      sp_window_set_profiler (self, profiler);
       break;
 
     default:


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