Skip to content

Commit

Permalink
Fix various TMTag leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
b4n committed Mar 17, 2013
1 parent fbce364 commit e409b70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/document.c
Expand Up @@ -605,6 +605,9 @@ static gboolean remove_page(guint page_num)
g_free(doc->real_path);
tm_workspace_remove_object(doc->tm_file, TRUE, TRUE);

if (doc->priv->tag_tree)
gtk_widget_destroy(doc->priv->tag_tree);

editor_destroy(doc->editor);
doc->editor = NULL; /* needs to be NULL for document_undo_clear() call below */

Expand Down
6 changes: 5 additions & 1 deletion src/symbols.c
Expand Up @@ -1525,6 +1525,7 @@ static void update_tree_tags(GeanyDocument *doc, GList **tags)
delta = d;
parent_search = node->data;
}
tm_tag_unref(parent_tag);
}
}

Expand Down Expand Up @@ -2300,7 +2301,7 @@ static void on_find_usage(GtkWidget *widget, gboolean in_session)
GtkTreeSelection *selection;
GtkTreeModel *model;
GeanyDocument *doc;
const TMTag *tag = NULL;
TMTag *tag = NULL;

doc = document_get_current();
if (!doc)
Expand All @@ -2310,7 +2311,10 @@ static void on_find_usage(GtkWidget *widget, gboolean in_session)
if (gtk_tree_selection_get_selected(selection, &model, &iter))
gtk_tree_model_get(model, &iter, SYMBOLS_COLUMN_TAG, &tag, -1);
if (tag)
{
search_find_usage(tag->name, tag->name, SCFIND_WHOLEWORD | SCFIND_MATCHCASE, in_session);
tm_tag_unref(tag);
}
}


Expand Down

0 comments on commit e409b70

Please sign in to comment.