Commit 49e57f8d authored by Ell's avatar Ell

app: in gimp_display_empty(), clear image of matching contexts

In gimp_display_empty(), clear the image of all contexts whose
display is the current display, so that, in particular, when
subsequently updating the action groups, which causes certain
actions to be activated, the image that used to be bound to the
display is not found through the user context.  This avoids re-
validating the image projection when closing the last image,
postponing image destruction.
parent b31729f8
......@@ -717,6 +717,7 @@ void
gimp_display_empty (GimpDisplay *display)
{
GimpDisplayPrivate *private;
GList *iter;
g_return_if_fail (GIMP_IS_DISPLAY (display));
......@@ -724,6 +725,14 @@ gimp_display_empty (GimpDisplay *display)
g_return_if_fail (GIMP_IS_IMAGE (private->image));
for (iter = display->gimp->context_list; iter; iter = g_list_next (iter))
{
GimpContext *context = iter->data;
if (gimp_context_get_display (context) == display)
gimp_context_set_image (context, NULL);
}
gimp_display_set_image (display, NULL);
gimp_display_shell_empty (gimp_display_get_shell (display));
......
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