Commit 2fc3ba5e authored by Maurits Rijk's avatar Maurits Rijk Committed by Maurits Rijk
Browse files

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.
parent 8cd1ab2e
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()
......
......@@ -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;
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_t *command, *sub_command;
GtkTreeModel *model;
GList *list, *selected_rows;
selected_rows = 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 = 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);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment