diff options
author | Havoc Pennington <hp@redhat.com> | 2001-09-21 23:56:43 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-09-21 23:56:43 +0000 |
commit | b7eec02f2ae69ed2a3de51981aabc8a9e2432ef5 (patch) | |
tree | f29626e12026fa766169b6935a24fa780c4f76f9 /gtk/gtktextmark.c | |
parent | 615b641adaab7f6cd86d077cd9590dd753a075e4 (diff) | |
download | gtk+-b7eec02f2ae69ed2a3de51981aabc8a9e2432ef5.tar.gz |
Bug #60862
2001-09-21 Havoc Pennington <hp@redhat.com>
Bug #60862
* gtk/gtktextbtree.c (gtk_text_btree_node_destroy):
(_gtk_text_btree_unref): fix up mark memory management
* gtk/gtktextmark.c (mark_segment_delete_func): ditto
Diffstat (limited to 'gtk/gtktextmark.c')
-rw-r--r-- | gtk/gtktextmark.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk/gtktextmark.c b/gtk/gtktextmark.c index 018eb089b5..1be324b11a 100644 --- a/gtk/gtktextmark.c +++ b/gtk/gtktextmark.c @@ -113,8 +113,6 @@ gtk_text_mark_finalize (GObject *obj) if (seg) { - g_return_if_fail (seg->body.mark.tree == NULL); - if (seg->body.mark.tree != NULL) g_warning ("GtkTextMark being finalized while still in the buffer; " "someone removed a reference they didn't own! Crash " @@ -320,21 +318,27 @@ GtkTextLineSegmentClass gtk_text_left_mark_type = { * a mark lies in a range of characters being deleted. * * Results: - * Returns 1 to indicate that deletion has been rejected. + * Returns 1 to indicate that deletion has been rejected, + * or 0 otherwise * * Side effects: - * None (even if the whole tree is being deleted we don't - * free up the mark; it will be done elsewhere). + * Frees mark if tree is going away * *-------------------------------------------------------------- */ static gboolean -mark_segment_delete_func (GtkTextLineSegment *segPtr, +mark_segment_delete_func (GtkTextLineSegment *seg, GtkTextLine *line, gboolean tree_gone) { - return TRUE; + if (tree_gone) + { + _gtk_text_btree_release_mark_segment (seg->body.mark.tree, seg); + return FALSE; + } + else + return TRUE; } /* |