[gnome-builder] snippet: don't leak snippet string attributes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippet: don't leak snippet string attributes
- Date: Thu, 13 Oct 2016 01:46:50 +0000 (UTC)
commit 5801d5ec064c18d43a7ea4c8c8faa47dd24025e2
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 12 18:46:41 2016 -0700
snippet: don't leak snippet string attributes
libide/snippets/ide-source-snippet.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/libide/snippets/ide-source-snippet.c b/libide/snippets/ide-source-snippet.c
index 33b0057..8ba313c 100644
--- a/libide/snippets/ide-source-snippet.c
+++ b/libide/snippets/ide-source-snippet.c
@@ -946,14 +946,18 @@ ide_source_snippet_dispose (GObject *object)
g_clear_object (&self->buffer);
g_clear_object (&self->snippet_context);
-
- g_free(self->language);
- g_free(self->description);
}
static void
ide_source_snippet_finalize (GObject *object)
{
+ IdeSourceSnippet *self = (IdeSourceSnippet *)object;
+
+ g_clear_pointer (&self->language, g_free);
+ g_clear_pointer (&self->description, g_free);
+ g_clear_pointer (&self->trigger, g_free);
+ g_clear_pointer (&self->snippet_text, g_free);
+
G_OBJECT_CLASS (ide_source_snippet_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]