gdkclipboard-win32.c: Fix call to gdk_clipboard_claim_remote()
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 31 Mar 2022 02:36:45 +0000 (10:36 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 1 Apr 2022 02:28:37 +0000 (10:28 +0800)
commitedd8d55b423f2b5b4c8c06b74d01652d126db9e1
tree3676b45e4e98a8b2ef3f9fd0f94c1374dfbddf98
parent3b50f2e8b996f92f49d2974ccff2b160905e8e73
gdkclipboard-win32.c: Fix call to gdk_clipboard_claim_remote()

The call to gdk_win32_clipboard_request_contentformats() can return NULL even
without an error condition being hit (such as when the system clipboard is
empty), so check whether the returned GdkContentFormat pointer is not NULL
before calling gdk_clipboard_claim_remote(), which expects it to be not NULL,
otherwise we face a warning from that funtion and the subsequent
g_object_unref().

This at least partially fixes issue #4796.
gdk/win32/gdkclipboard-win32.c