From 50a227058a8d72f1fb885458b882cedb0e0d7f79 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 9 Apr 2015 22:38:11 -0400 Subject: Changed the allocation logging from a compile-time setting to the first initialization option. --- new/container_unix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'new/container_unix.c') diff --git a/new/container_unix.c b/new/container_unix.c index 279e418..5ee421c 100644 --- a/new/container_unix.c +++ b/new/container_unix.c @@ -5,9 +5,8 @@ G_DEFINE_TYPE(uiContainer, uiContainer, GTK_TYPE_CONTAINER) static void uiContainer_init(uiContainer *c) { -#ifdef uiLogAllocations - fprintf(stderr, "%p alloc uiContainer\n", c); -#endif + if (options.debugLogAllocations) + fprintf(stderr, "%p alloc uiContainer\n", c); c->children = g_ptr_array_new(); gtk_widget_set_has_window(GTK_WIDGET(c), FALSE); } @@ -32,9 +31,8 @@ static void uiContainer_dispose(GObject *obj) static void uiContainer_finalize(GObject *obj) { G_OBJECT_CLASS(uiContainer_parent_class)->finalize(obj); -#ifdef uiLogAllocations - fprintf(stderr, "%p free\n", obj); -#endif + if (options.debugLogAllocations) + fprintf(stderr, "%p free\n", obj); } static void uiContainer_add(GtkContainer *container, GtkWidget *widget) -- cgit v1.2.3