[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: finished signal should not be handled if image response is canceled

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Oct 27 19:27:35 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
8f1a362c by Fatih Uzunoglu at 2024-10-27T18:57:44+00:00
qt: finished signal should not be handled if image response is canceled

An image response does not cancel itself, so it can not be considered
error, and it obviously can not be considered success as well.

The purpose of signalling `finished()` is to inform that it is ready
for deletion.

- - - - -
df08ba7c by Fatih Uzunoglu at 2024-10-27T18:57:44+00:00
qt: do not request delete for image response before it signals finished

When an image response is canceled, it signals `finished()` so that it
can be deleted safely. Requesting deletion before `finished()` is
signaled is ill behavior.

- - - - -


1 changed file:

- modules/gui/qt/widgets/native/roundimage.cpp


Changes:

=====================================
modules/gui/qt/widgets/native/roundimage.cpp
=====================================
@@ -229,9 +229,15 @@ RoundImageRequest::~RoundImageRequest()
     if (m_imageResponse)
     {
         if (m_cancelOnDelete)
+        {
+            disconnect(m_imageResponse, &QQuickImageResponse::finished, this, &RoundImageRequest::handleImageResponseFinished);
+            connect(m_imageResponse, &QQuickImageResponse::finished, m_imageResponse, &QObject::deleteLater);
             m_imageResponse->cancel();
-
-        m_imageResponse->deleteLater();
+        }
+        else
+        {
+            m_imageResponse->deleteLater();
+        }
     }
     g_imageCache.removeRequest(m_key);
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b1e1164154c80a1da9c30bf2a50ebc2b2c5e6ad1...df08ba7c55cf6f85f479285ffbc37fcbd6bd77a0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b1e1164154c80a1da9c30bf2a50ebc2b2c5e6ad1...df08ba7c55cf6f85f479285ffbc37fcbd6bd77a0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list