mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
cogl-trace: Cleanup context after disabling
This allows running the Capture() method multiple times, with different arguments each time. https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
This commit is contained in:
parent
17c5436f6e
commit
53748e3da7
@ -59,6 +59,13 @@ cogl_trace_context_new (int fd)
|
||||
return context;
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_trace_context_free (CoglTraceContext *trace_context)
|
||||
{
|
||||
g_clear_pointer (&trace_context->writer, sysprof_capture_writer_unref);
|
||||
g_free (trace_context);
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_trace_context (int fd)
|
||||
{
|
||||
@ -135,6 +142,9 @@ disable_tracing_idle_callback (gpointer user_data)
|
||||
g_mutex_lock (&cogl_trace_mutex);
|
||||
trace_context = cogl_trace_context;
|
||||
sysprof_capture_writer_flush (trace_context->writer);
|
||||
|
||||
g_clear_pointer (&cogl_trace_context, cogl_trace_context_free);
|
||||
|
||||
g_mutex_unlock (&cogl_trace_mutex);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
|
Loading…
Reference in New Issue
Block a user