[mutter/gbsneto/tracing: 5/7] cogl-trace: Cleanup context after disabling
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/tracing: 5/7] cogl-trace: Cleanup context after disabling
- Date: Fri, 12 Apr 2019 19:35:36 +0000 (UTC)
commit 2d1ef87b077cf941e5aa384e82856e91ae51d0ca
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Aug 10 22:06:30 2018 -0300
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
cogl/cogl/cogl-trace.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/cogl/cogl/cogl-trace.c b/cogl/cogl/cogl-trace.c
index 7096cdddb..2b88cbe88 100644
--- a/cogl/cogl/cogl-trace.c
+++ b/cogl/cogl/cogl-trace.c
@@ -52,6 +52,13 @@ cogl_trace_context_new (int fd)
return context;
}
+static void
+cogl_trace_context_free (CoglTraceContext *trace_context)
+{
+ g_clear_pointer (&trace_context->writer, sp_capture_writer_unref);
+ g_free (trace_context);
+}
+
static void
ensure_trace_context (int fd)
{
@@ -128,6 +135,10 @@ disable_tracing_idle_callback (gpointer user_data)
g_mutex_lock (&cogl_trace_mutex);
trace_context = cogl_trace_context;
sp_capture_writer_flush (trace_context->writer);
+
+ cogl_trace_context_free (cogl_trace_context);
+ cogl_trace_context = NULL;
+
g_mutex_unlock (&cogl_trace_mutex);
return G_SOURCE_REMOVE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]