plug memory leak. Fixes #305995.

2005-05-31  Maurits Rijk  <m.rijk@chello.nl>

	* plug-ins/imagemap/imap_selection.c: plug memory leak. Fixes #305995.
This commit is contained in:
Maurits Rijk 2005-05-31 18:05:10 +00:00 committed by Maurits Rijk
parent 8cd1ab2e28
commit 2fc3ba5e7a
2 changed files with 40 additions and 31 deletions

View File

@ -1,3 +1,7 @@
2005-05-31 Maurits Rijk <m.rijk@chello.nl>
* plug-ins/imagemap/imap_selection.c: plug memory leak. Fixes #305995.
2005-05-31 Sven Neumann <sven@gimp.org>
* plug-ins/common/screenshot.c (select_window_x11): use XGrabKey()

View File

@ -65,39 +65,44 @@ changed_cb(GtkTreeSelection *selection, gpointer param)
{
Selection_t *data = (Selection_t*) param;
if (data->select_lock) {
data->select_lock = FALSE;
} else {
Command_t *command, *sub_command;
GtkTreeModel *model;
GList *list = gtk_tree_selection_get_selected_rows (selection, &model);
command = subcommand_start (NULL);
sub_command = unselect_all_command_new (data->object_list, NULL);
command_add_subcommand (command, sub_command);
for (; list; list = list->next)
if (data->select_lock)
{
data->select_lock = FALSE;
} else
{
Object_t *obj;
GtkTreeIter iter;
GtkTreePath *path = (GtkTreePath*) list->data;
Command_t *command, *sub_command;
GtkTreeModel *model;
GList *list, *selected_rows;
selected_rows = gtk_tree_selection_get_selected_rows (selection,
&model);
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter, 0, &obj, -1);
sub_command = select_command_new (obj);
command_add_subcommand (command, sub_command);
}
command_set_name (command, sub_command->name);
subcommand_end ();
command_execute (command);
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
set_buttons (data);
command = subcommand_start (NULL);
sub_command = unselect_all_command_new (data->object_list, NULL);
command_add_subcommand (command, sub_command);
for (list = selected_rows; list; list = list->next)
{
Object_t *obj;
GtkTreeIter iter;
GtkTreePath *path = (GtkTreePath*) list->data;
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter, 0, &obj, -1);
sub_command = select_command_new (obj);
command_add_subcommand (command, sub_command);
}
command_set_name (command, sub_command->name);
subcommand_end ();
command_execute (command);
g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
g_list_free (selected_rows);
set_buttons (data);
}
}