[gnome-music/wip/mschraal/gtk4-v3: 191/192] artcache: Close stream later




commit be8cbf90f1999e3ad2bbefdf7daa55eb49ec8a55
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat Feb 5 20:45:56 2022 +0100

    artcache: Close stream later
    
    It makes sense to make sure the paintable is set before we close the
    stream and signal the paintable.

 gnomemusic/artcache.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/artcache.py b/gnomemusic/artcache.py
index 8a9fc9c3d..f6f3f0f90 100644
--- a/gnomemusic/artcache.py
+++ b/gnomemusic/artcache.py
@@ -111,15 +111,15 @@ class ArtCache(GObject.GObject):
             self.emit("finished", self._paintable)
             return
 
-        stream.close_async(
-            GLib.PRIORITY_DEFAULT_IDLE, None, self._close_stream, None)
-
         texture = Gdk.Texture.new_for_pixbuf(pixbuf)
         if texture:
             self._paintable = CoverPaintable(
                 self._size, self._widget, icon_type=self._icon_type,
                 texture=texture)
 
+        stream.close_async(
+            GLib.PRIORITY_DEFAULT_IDLE, None, self._close_stream, None)
+
     def _close_stream(self, stream, result, data):
         try:
             stream.close_finish(result)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]