sysprof: make escape stop the current profiler

This commit is contained in:
Christian Hergert
2019-05-20 18:26:25 -07:00
parent 28def4c34e
commit f330de967b
3 changed files with 46 additions and 11 deletions

View File

@ -254,13 +254,11 @@ stop_recording_cb (GSimpleAction *action,
gpointer user_data)
{
SysprofDisplay *self = user_data;
SysprofDisplayPrivate *priv = sysprof_display_get_instance_private (self);
g_assert (G_IS_SIMPLE_ACTION (action));
g_assert (SYSPROF_IS_DISPLAY (self));
if (priv->profiler != NULL)
sysprof_profiler_stop (priv->profiler);
sysprof_display_stop_recording (self);
}
static void
@ -572,3 +570,14 @@ sysprof_display_get_can_save (SysprofDisplay *self)
return sysprof_capture_view_get_reader (priv->capture_view) != NULL;
}
void
sysprof_display_stop_recording (SysprofDisplay *self)
{
SysprofDisplayPrivate *priv = sysprof_display_get_instance_private (self);
g_return_if_fail (SYSPROF_IS_DISPLAY (self));
if (priv->profiler != NULL)
sysprof_profiler_stop (priv->profiler);
}