mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
app: fix #13555 crash in clipboard when closing
Apparently the gimpclipboard_send_* functions can be called when gimp_clip has already been cleared, usually at shutdown. This is causing crashes sometimes that I have not been able to reproduce. Fixing this at the source would be best, but I have not been able to figure out where that would be. So, next best thing is adding a check to bail out early when gimp_clip is NULL.
This commit is contained in:
@@ -1152,6 +1152,9 @@ gimp_clipboard_send_image (GtkClipboard *clipboard,
|
||||
{
|
||||
GimpClipboard *gimp_clip = gimp_clipboard_get (gimp);
|
||||
|
||||
if (gimp_clip == NULL)
|
||||
return;
|
||||
|
||||
gimp_set_busy (gimp);
|
||||
|
||||
if (info == 0)
|
||||
@@ -1212,6 +1215,9 @@ gimp_clipboard_send_buffer (GtkClipboard *clipboard,
|
||||
GimpClipboard *gimp_clip = gimp_clipboard_get (gimp);
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
if (gimp_clip == NULL)
|
||||
return;
|
||||
|
||||
gimp_set_busy (gimp);
|
||||
|
||||
pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (gimp_clip->buffer),
|
||||
@@ -1256,6 +1262,9 @@ gimp_clipboard_send_svg (GtkClipboard *clipboard,
|
||||
{
|
||||
GimpClipboard *gimp_clip = gimp_clipboard_get (gimp);
|
||||
|
||||
if (gimp_clip == NULL)
|
||||
return;
|
||||
|
||||
gimp_set_busy (gimp);
|
||||
|
||||
if (gimp_clip->svg)
|
||||
@@ -1280,6 +1289,9 @@ gimp_clipboard_send_curve (GtkClipboard *clipboard,
|
||||
{
|
||||
GimpClipboard *gimp_clip = gimp_clipboard_get (gimp);
|
||||
|
||||
if (gimp_clip == NULL)
|
||||
return;
|
||||
|
||||
gimp_set_busy (gimp);
|
||||
|
||||
if (gimp_clip->curve)
|
||||
|
Reference in New Issue
Block a user