app: fix CRITICAL when using "show all" by default

When using "show all" by default, gimp_display_flush() can be
called during GimpDisplayShell construction, before the newly-
constructed shell is assigned to the display.  Use an ugly hack to
just ignore the flush when this happens.

(cherry picked from commit 0a06294af7)
This commit is contained in:
Ell
2020-05-16 15:51:27 +03:00
parent 3899d75a98
commit bd892491f4

View File

@ -870,7 +870,12 @@ gimp_display_flush (GimpDisplay *display)
{ {
g_return_if_fail (GIMP_IS_DISPLAY (display)); g_return_if_fail (GIMP_IS_DISPLAY (display));
gimp_display_flush_whenever (display, FALSE); /* FIXME: we can end up being called during shell construction if "show all"
* is enabled by default, in which case the shell's display pointer is still
* NULL
*/
if (gimp_display_get_shell (display))
gimp_display_flush_whenever (display, FALSE);
} }
void void