[gnome-builder] snippets: add counters for snippets
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: add counters for snippets
- Date: Sun, 18 Jun 2017 05:23:01 +0000 (UTC)
commit 6c30c7375ca8314bab8df02c77a87b8868888490
Author: Christian Hergert <chergert redhat com>
Date: Sat Jun 17 22:22:26 2017 -0700
snippets: add counters for snippets
Just to keep an eye on things
libide/snippets/ide-source-snippet.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libide/snippets/ide-source-snippet.c b/libide/snippets/ide-source-snippet.c
index 859fe6a..671bb77 100644
--- a/libide/snippets/ide-source-snippet.c
+++ b/libide/snippets/ide-source-snippet.c
@@ -18,6 +18,7 @@
#define G_LOG_DOMAIN "ide-source-snippet"
+#include <dazzle.h>
#include <glib/gi18n.h>
#include "ide-debug.h"
@@ -67,6 +68,8 @@ enum {
G_DEFINE_TYPE (IdeSourceSnippet, ide_source_snippet, G_TYPE_OBJECT)
+DZL_DEFINE_COUNTER (instances, "Snippets", "N Snippets", "Number of IdeSourceSnippet instances.");
+
static GParamSpec * properties[LAST_PROP];
IdeSourceSnippet *
@@ -1045,6 +1048,8 @@ ide_source_snippet_finalize (GObject *object)
g_clear_pointer (&self->snippet_text, g_free);
G_OBJECT_CLASS (ide_source_snippet_parent_class)->finalize (object);
+
+ DZL_COUNTER_DEC (instances);
}
static void
@@ -1199,6 +1204,8 @@ ide_source_snippet_class_init (IdeSourceSnippetClass *klass)
static void
ide_source_snippet_init (IdeSourceSnippet *self)
{
+ DZL_COUNTER_INC (instances);
+
self->max_tab_stop = -1;
self->chunks = g_ptr_array_new_with_free_func (g_object_unref);
self->runs = g_array_new (FALSE, FALSE, sizeof (gint));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]