[gnome-music/wip/jfelder/gtk4-v3: 10/12] artcache: Close stream later




commit d0c02f93ceafff541da06004896ab61f83eb38c2
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 d4bae6304..bb7d9c635 100644
--- a/gnomemusic/artcache.py
+++ b/gnomemusic/artcache.py
@@ -109,15 +109,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]