From 89e75fae2d54c2baad94d90060bee349e80b9994 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 14 Apr 2016 05:39:49 -0700 Subject: [PATCH] profiler: reset timer when starting If we reuse the profiler instance (not convinced this is a good idea yet) then we could have a nonzero elapsed time. Reset it immediately so that the UI doesn't jitter between the previous value and 00:00. --- lib/sp-local-profiler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sp-local-profiler.c b/lib/sp-local-profiler.c index f3ca1620..59cd5f15 100644 --- a/lib/sp-local-profiler.c +++ b/lib/sp-local-profiler.c @@ -459,6 +459,9 @@ sp_local_profiler_start (SpProfiler *profiler) g_return_if_fail (priv->is_stopping == FALSE); g_return_if_fail (priv->is_starting == FALSE); + g_clear_pointer (&priv->timer, g_timer_destroy); + g_object_notify (G_OBJECT (self), "elapsed"); + if (priv->writer == NULL) { SpCaptureWriter *writer;