]> git.sur5r.net Git - glabels/commitdiff
2005-10-29 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sun, 30 Oct 2005 01:16:43 +0000 (01:16 +0000)
committerJim Evins <evins@snaught.com>
Sun, 30 Oct 2005 01:16:43 +0000 (01:16 +0000)
* src/glabels.c: (main):
* src/label-barcode.c: (gl_label_barcode_finalize):
* src/label-text.c: (gl_label_text_finalize), (set_font_family):
* src/label.c: (gl_label_instance_init), (gl_label_finalize):
* src/object-editor.c: (gl_object_editor_finalize):
Another pass at valgrinding -- plugged several memory leaks.
* src/view-text.c: (gl_view_text_new),
(update_canvas_item_from_object_cb), (draw_hacktext):
Commented out artifacts of edit-in-place code.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@560 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/src/glabels.c
glabels2/src/label-barcode.c
glabels2/src/label-text.c
glabels2/src/label.c
glabels2/src/object-editor.c
glabels2/src/view-text.c

index 60750ccdf387d7fb68deed8b49d17af659802894..f575612762939675f3964c328e2cf57ab9479b57 100644 (file)
@@ -1,3 +1,15 @@
+2005-10-29  Jim Evins  <evins@snaught.com>
+
+       * src/glabels.c: (main):
+       * src/label-barcode.c: (gl_label_barcode_finalize):
+       * src/label-text.c: (gl_label_text_finalize), (set_font_family):
+       * src/label.c: (gl_label_instance_init), (gl_label_finalize):
+       * src/object-editor.c: (gl_object_editor_finalize):
+               Another pass at valgrinding -- plugged several memory leaks.
+       * src/view-text.c: (gl_view_text_new),
+       (update_canvas_item_from_object_cb), (draw_hacktext):
+               Commented out artifacts of edit-in-place code.
+       
 2005-10-28  Jim Evins  <evins@snaught.com>
 
        * src/canvas-hacktext.c: (gl_canvas_hacktext_set_arg):
index 01fe818699c58353e470cb7e4d2e0c2dd54c3b14..8cb329d3701cc4577a6f2399d639c1be60413d1e 100644 (file)
@@ -153,7 +153,9 @@ main (int argc, char **argv)
        
        /* Begin main loop */
        gtk_main();
-               
+
+       g_object_unref (G_OBJECT (program));
+
        return 0;
 }
 
index 9ec54c970480041f84f1050f530c9b63223f77be..805d6b578a0bf247c48dc83d965325cb5396a986 100644 (file)
@@ -138,8 +138,9 @@ gl_label_barcode_finalize (GObject *object)
 
        lbc = GL_LABEL_BARCODE (object);
 
-       gl_color_node_free (&(lbc->private->color_node));
        gl_text_node_free (&lbc->private->text_node);
+       g_free (lbc->private->id);
+       gl_color_node_free (&(lbc->private->color_node));
        g_free (lbc->private);
 
        G_OBJECT_CLASS (parent_class)->finalize (object);
index 9d4cdd291470c7da9df8dc27527bf82fa049d4ac..fd8da7e17344a85bc269f7ad461c135289a1a90a 100644 (file)
@@ -212,9 +212,10 @@ gl_label_text_finalize (GObject *object)
 
        ltext = GL_LABEL_TEXT (object);
 
-       gl_color_node_free (&(ltext->private->color_node));
        g_object_unref (ltext->private->tag_table);
        g_object_unref (ltext->private->buffer);
+       g_free (ltext->private->font_family);
+       gl_color_node_free (&(ltext->private->color_node));
        g_free (ltext->private);
 
        G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -449,6 +450,7 @@ set_font_family (glLabelObject *object,
 
        if (ltext->private->font_family) {
                if (g_strcasecmp (ltext->private->font_family, good_font_family) == 0) {
+                       g_free (good_font_family);
                        gl_debug (DEBUG_LABEL, "END (no change)");
                        return;
                }
index 2497ab2346b6c025efb892bec5edc2f465d6c2c5..e80c0a1756564a31b2e3b9b293a6c7a8e83932be 100644 (file)
@@ -185,7 +185,9 @@ gl_label_instance_init (glLabel *label)
        gl_debug (DEBUG_LABEL, "START");
 
        label->private = g_new0 (glLabelPrivate, 1);
-       label->private->merge = NULL;
+       label->private->template     = NULL;
+       label->private->filename     = NULL;
+       label->private->merge        = NULL;
        label->private->pixbuf_cache = gl_pixbuf_cache_new ();
 
        gl_debug (DEBUG_LABEL, "END");
@@ -203,17 +205,16 @@ gl_label_finalize (GObject *object)
 
        label = GL_LABEL (object);
 
-       gl_template_free (label->private->template);
-
        for (p = label->objects; p != NULL; p = p_next) {
                p_next = p->next;       /* NOTE: p will be left dangling */
                g_object_unref (G_OBJECT(p->data));
        }
 
+       gl_template_free (label->private->template);
+       g_free (label->private->filename);
        if (label->private->merge != NULL) {
                g_object_unref (G_OBJECT(label->private->merge));
        }
-
        gl_pixbuf_cache_free (label->private->pixbuf_cache);
 
        g_free (label->private);
index d9eb29899d3cf74c9ab18532750851776c6ea4ee..3b2cf9ba93830cb3e220e86c2d7ba1fb416c3a9b 100644 (file)
@@ -192,6 +192,10 @@ gl_object_editor_finalize (GObject *object)
        g_return_if_fail (GL_IS_OBJECT_EDITOR (editor));
        g_return_if_fail (editor->priv != NULL);
 
+       if (editor->priv->gui) {
+               g_object_unref (G_OBJECT (editor->priv->gui));
+       }
+
        g_free (editor->priv);
 
        g_signal_handlers_disconnect_by_func (G_OBJECT(gl_prefs),
index 67a618e70e3cac3a672d874c177c5f6fc1e70616..f2a078bdfaf79321f212dbf11ce401dc7dc9cf52 100644 (file)
@@ -57,11 +57,12 @@ struct _glViewTextPrivate {
 
        GList           *item_list;
 
+#ifdef EDIT_TEXT_IN_PLACE
        GnomeCanvasItem *cursor;
        gboolean         cursor_visible;
        gboolean         cursor_state;
        guint            cursor_timeout;
-
+#endif
 };
 
 /*========================================================*/
@@ -217,7 +218,9 @@ gl_view_text_new (glLabelText *object,
 
        /* Create analogous canvas item. */
        draw_hacktext (view_text);
+#ifdef EDIT_TEXT_IN_PLACE
        draw_cursor (view_text);
+#endif
 
        g_signal_connect (G_OBJECT (object), "changed",
                          G_CALLBACK (update_canvas_item_from_object_cb), view_text);
@@ -226,8 +229,10 @@ gl_view_text_new (glLabelText *object,
                          G_CALLBACK (item_event_cb), view_text);
 
        buffer = gl_label_text_get_buffer (object);
+#ifdef EDIT_TEXT_IN_PLACE
        g_signal_connect (G_OBJECT (buffer), "mark-set",
                          G_CALLBACK (mark_set_cb), view_text);
+#endif
 
        gl_debug (DEBUG_VIEW, "END");
 
@@ -295,7 +300,9 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        /* Adjust appearance of analogous canvas item. */
        draw_hacktext (view_text);
+#ifdef EDIT_TEXT_IN_PLACE
        draw_cursor (view_text);
+#endif
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -753,6 +760,7 @@ draw_hacktext (glViewText *view_text)
        }
 
        /* clean up */
+       g_free (font_family);
        gl_color_node_free (&color_node);
        g_strfreev (line);
        g_free (text);
@@ -760,6 +768,7 @@ draw_hacktext (glViewText *view_text)
        gl_debug (DEBUG_VIEW, "END");
 }
 
+#ifdef EDIT_TEXT_IN_PLACE
 /*--------------------------------------------------------------------------*/
 /* PRIVATE.  Draw cursor to item (group).                                   */
 /*--------------------------------------------------------------------------*/
@@ -971,6 +980,8 @@ blink_cb (glViewText *view_text)
        return FALSE;
 }
 
+#endif /* EDIT_TEXT_IN_PLACE */
+
 /*--------------------------------------------------------------------------*/
 /* PRIVATE.  Item event callback.                                           */
 /*--------------------------------------------------------------------------*/