app: don't leak the list returned by gimp_get_image_windows()
This commit is contained in:
@ -273,7 +273,6 @@ dialogs_actions_toolbox_exists (Gimp *gimp)
|
|||||||
{
|
{
|
||||||
GimpDialogFactory *factory = gimp_dialog_factory_get_singleton ();
|
GimpDialogFactory *factory = gimp_dialog_factory_get_singleton ();
|
||||||
GimpSessionInfo *info = NULL;
|
GimpSessionInfo *info = NULL;
|
||||||
GList *windows = gimp ? gimp_get_image_windows (gimp) : NULL;
|
|
||||||
gboolean toolbox_found = FALSE;
|
gboolean toolbox_found = FALSE;
|
||||||
GList *iter;
|
GList *iter;
|
||||||
|
|
||||||
@ -284,6 +283,8 @@ dialogs_actions_toolbox_exists (Gimp *gimp)
|
|||||||
/* Then in image windows */
|
/* Then in image windows */
|
||||||
if (! toolbox_found)
|
if (! toolbox_found)
|
||||||
{
|
{
|
||||||
|
GList *windows = gimp ? gimp_get_image_windows (gimp) : NULL;
|
||||||
|
|
||||||
for (iter = windows; iter; iter = g_list_next (iter))
|
for (iter = windows; iter; iter = g_list_next (iter))
|
||||||
{
|
{
|
||||||
GimpImageWindow *window = GIMP_IMAGE_WINDOW (windows->data);
|
GimpImageWindow *window = GIMP_IMAGE_WINDOW (windows->data);
|
||||||
@ -294,6 +295,8 @@ dialogs_actions_toolbox_exists (Gimp *gimp)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_list_free (windows);
|
||||||
}
|
}
|
||||||
|
|
||||||
return toolbox_found;
|
return toolbox_found;
|
||||||
|
Reference in New Issue
Block a user