[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/20] ui: fix gtk clipboard clear assertion
From: |
Gerd Hoffmann |
Subject: |
[PULL 08/20] ui: fix gtk clipboard clear assertion |
Date: |
Fri, 14 Jan 2022 07:53:14 +0100 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
When closing the QEMU Gtk display window, it can occasionaly warn:
qemu-system-x86_64: Gtk: gtk_clipboard_set_with_data: assertion 'targets !=
NULL' failed
#3 0x00007ffff4f02f22 in gtk_clipboard_set_with_data (clipboard=<optimized
out>, targets=<optimized out>, n_targets=<optimized out>, get_func=<optimized
out>, clear_func=<optimized out>, user_data=<optimized out>) at
/usr/src/debug/gtk3-3.24.30-4.fc35.x86_64/gtk/gtkclipboard.c:672
#4 0x00007ffff552cd75 in gd_clipboard_update_info (gd=0x5555579a9e00,
info=0x555557ba4b50) at ../ui/gtk-clipboard.c:98
#5 0x00007ffff552ce00 in gd_clipboard_notify (notifier=0x5555579aaba8,
data=0x7fffffffd720) at ../ui/gtk-clipboard.c:128
#6 0x000055555603e0ff in notifier_list_notify (list=0x555556657470
<clipboard_notifiers>, data=0x7fffffffd720) at ../util/notify.c:39
#7 0x000055555594e8e0 in qemu_clipboard_update (info=0x555557ba4b50) at
../ui/clipboard.c:54
#8 0x000055555594e840 in qemu_clipboard_peer_release (peer=0x55555684a5b0,
selection=QEMU_CLIPBOARD_SELECTION_PRIMARY) at ../ui/clipboard.c:40
#9 0x000055555594e786 in qemu_clipboard_peer_unregister (peer=0x55555684a5b0)
at ../ui/clipboard.c:19
#10 0x000055555595f044 in vdagent_disconnect (vd=0x55555684a400) at
../ui/vdagent.c:852
#11 0x000055555595f262 in vdagent_chr_fini (obj=0x55555684a400) at
../ui/vdagent.c:908
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211216083233.1166504-1-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/gtk-clipboard.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c
index e0b8b283fef8..d58fd761abdf 100644
--- a/ui/gtk-clipboard.c
+++ b/ui/gtk-clipboard.c
@@ -83,7 +83,7 @@ static void gd_clipboard_update_info(GtkDisplayState *gd,
if (info != qemu_clipboard_info(s)) {
gd->cbpending[s] = 0;
if (!self_update) {
- GtkTargetList *list;
+ g_autoptr(GtkTargetList) list = NULL;
GtkTargetEntry *targets;
gint n_targets;
@@ -94,15 +94,16 @@ static void gd_clipboard_update_info(GtkDisplayState *gd,
targets = gtk_target_table_new_from_list(list, &n_targets);
gtk_clipboard_clear(gd->gtkcb[s]);
- gd->cbowner[s] = true;
- gtk_clipboard_set_with_data(gd->gtkcb[s],
- targets, n_targets,
- gd_clipboard_get_data,
- gd_clipboard_clear,
- gd);
+ if (targets) {
+ gd->cbowner[s] = true;
+ gtk_clipboard_set_with_data(gd->gtkcb[s],
+ targets, n_targets,
+ gd_clipboard_get_data,
+ gd_clipboard_clear,
+ gd);
- gtk_target_table_free(targets, n_targets);
- gtk_target_list_unref(list);
+ gtk_target_table_free(targets, n_targets);
+ }
}
return;
}
--
2.34.1
- [PULL 00/20] Kraxel 20220114 patches, Gerd Hoffmann, 2022/01/14
- [PULL 01/20] hw/usb/dev-wacom: add missing HID descriptor, Gerd Hoffmann, 2022/01/14
- [PULL 02/20] usb: allow max 8192 bytes for desc, Gerd Hoffmann, 2022/01/14
- [PULL 03/20] ui/vnc.c: Fixed a deadlock bug., Gerd Hoffmann, 2022/01/14
- [PULL 05/20] dsoundaudio: fix crackling audio recordings, Gerd Hoffmann, 2022/01/14
- [PULL 08/20] ui: fix gtk clipboard clear assertion,
Gerd Hoffmann <=
- [PULL 10/20] hw/display: Rename VGA_ISA_MM -> VGA_MMIO, Gerd Hoffmann, 2022/01/14
- [PULL 04/20] jackaudio: use ifdefs to hide unavailable functions, Gerd Hoffmann, 2022/01/14
- [PULL 09/20] uas: add missing return, Gerd Hoffmann, 2022/01/14
- [PULL 06/20] hw/audio/intel-hda: fix stream reset, Gerd Hoffmann, 2022/01/14
- [PULL 11/20] hw/display/vga-mmio: Inline vga_mm_init(), Gerd Hoffmann, 2022/01/14
- [PULL 12/20] hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO, Gerd Hoffmann, 2022/01/14
- [PULL 15/20] edid: Added support for 4k@60 Hz monitor, Gerd Hoffmann, 2022/01/14
- [PULL 20/20] ui/input-legacy: pass horizontal scroll information, Gerd Hoffmann, 2022/01/14
- [PULL 07/20] ui/dbus: fix buffer-overflow detected by ASAN, Gerd Hoffmann, 2022/01/14
- [PULL 13/20] hw/mips/jazz: Inline vga_mmio_init() and remove it, Gerd Hoffmann, 2022/01/14