Files
virt-manager/009-avoid-NoneType-pixbuf.patch
Charles Arnold 2da9b6a6ef - Upstream features and bug fixes (bsc#1027942) (jsc#PED-14625)
003-virtinst-cloudinit-include-empty-meta-data-file.patch
  009-avoid-NoneType-pixbuf.patch
  012-virtManager-wrapped-details-hw-panel-with-GtkScrolledWindow.patch
  013-virtinst-interface-add-support-for-backend.hostname-and-backend.fqdn.patch
  014-virtinst-add-support-for-acpi-generic-initiator.patch
  015-virtinst-add-support-for-pcihole64.patch
  017-maint-use-constants-instead-of-strings-for-boot-devices.patch
  018-virtinst-rework-get_boot_order.patch
  019-virtinst-guest-introduce-can_use_device_boot_order.patch
  020-virtinst-remove-legacy-attribute-from-set_boot_order-get_boot_order.patch
  021-installer-add-support-to-use-device-boot-order.patch
  024-virtinst-Fix-XDG_DATA_HOME-handling.patch
- Dropped virtinst-fix-XDG_DATA_HOME-handling.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=738
2026-01-07 21:43:42 +00:00

28 lines
1.0 KiB
Diff

Subject: Calling loader.close() before pixbuf assignment to avoid NoneType pixbuf
From: ropbear ropbear@selfhosted.systems Fri Oct 31 17:41:15 2025 -0400
Date: Tue Nov 11 08:48:15 2025 +0100:
Git: f907ede75bbcfd87cc49f18d0da3e0bfec3d29f8
In the case loader.close() has more parsing to do, get_pixbuf() can
return a NoneType which causes issues in the snapshot view. Calling
loader.close() before this allows for proper cleanup before calling
get_pixbuf().
https://docs.gtk.org/gdk-pixbuf/method.PixbufLoader.close.html
https://docs.gtk.org/gdk-pixbuf/method.PixbufLoader.get_pixbuf.html
diff --git a/virtManager/details/snapshots.py b/virtManager/details/snapshots.py
index 0d413a98d..f2b229f5e 100644
--- a/virtManager/details/snapshots.py
+++ b/virtManager/details/snapshots.py
@@ -32,8 +32,8 @@ mimemap = {
def _make_screenshot_pixbuf(mime, sdata):
loader = GdkPixbuf.PixbufLoader.new_with_mime_type(mime)
loader.write(sdata)
- pixbuf = loader.get_pixbuf()
loader.close()
+ pixbuf = loader.get_pixbuf()
maxsize = 450