[vlc-commits] [Git][videolan/vlc][master] contrib: qtdeclarative: fix for QQuickAsyncImageProvider causes crash without Qt Network
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jun 28 14:48:42 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
bece856e by Fatih Uzunoglu at 2024-06-28T13:13:58+00:00
contrib: qtdeclarative: fix for QQuickAsyncImageProvider causes crash without Qt Network
- - - - -
2 changed files:
- + contrib/src/qtdeclarative/0001-Take-care-of-asyncResponses-when-qml_network-is-disa.patch
- contrib/src/qtdeclarative/rules.mak
Changes:
=====================================
contrib/src/qtdeclarative/0001-Take-care-of-asyncResponses-when-qml_network-is-disa.patch
=====================================
@@ -0,0 +1,89 @@
+From c3390f17d4c86a6c817f37a273c2d44d5f57ded9 Mon Sep 17 00:00:00 2001
+From: Fatih Uzunoglu <fuzun54 at outlook.com>
+Date: Mon, 24 Jun 2024 17:19:20 +0300
+Subject: [PATCH] Take care of `asyncResponses` when `qml_network` is disabled
+ in qquickpixmapcache.cpp
+
+---
+ src/quick/util/qquickpixmapcache.cpp | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
+index 8de79f2009..5efd2ef3e2 100644
+--- a/src/quick/util/qquickpixmapcache.cpp
++++ b/src/quick/util/qquickpixmapcache.cpp
+@@ -606,20 +606,18 @@ QQuickPixmapReader::~QQuickPixmapReader()
+ delete reply;
+ }
+ jobs.clear();
+-#if QT_CONFIG(qml_network)
+ const auto cancelJob = [this](QQuickPixmapReply *reply) {
+ if (reply->loading) {
+ cancelledJobs.append(reply);
+ reply->data = nullptr;
+ }
+ };
+-
++#if QT_CONFIG(qml_network)
+ for (auto *reply : std::as_const(networkJobs))
+ cancelJob(reply);
+-
++#endif
+ for (auto *reply : std::as_const(asyncResponses))
+ cancelJob(reply);
+-#endif
+ #if !QT_CONFIG(quick_pixmap_cache_threaded_download)
+ // In this case we won't be waiting, but we are on the correct thread already, so we can
+ // perform housekeeping synchronously now.
+@@ -640,7 +638,6 @@ QQuickPixmapReader::~QQuickPixmapReader()
+ wait();
+ #endif
+
+-#if QT_CONFIG(qml_network)
+ // While we've been waiting, the other thread may have added
+ // more replies. No one will care about them anymore.
+
+@@ -649,16 +646,17 @@ QQuickPixmapReader::~QQuickPixmapReader()
+ reply->data->reply = nullptr;
+ delete reply;
+ };
+-
++#if QT_CONFIG(qml_network)
+ for (QQuickPixmapReply *reply : std::as_const(networkJobs))
+ deleteReply(reply);
+-
++#endif
+ for (QQuickPixmapReply *reply : std::as_const(asyncResponses))
+ deleteReply(reply);
+
++#if QT_CONFIG(qml_network)
+ networkJobs.clear();
+- asyncResponses.clear();
+ #endif
++ asyncResponses.clear();
+ }
+
+ #if QT_CONFIG(qml_network)
+@@ -803,7 +801,10 @@ void QQuickPixmapReader::processJobs()
+ // cancel any jobs already started
+ reply->close();
+ }
+- } else {
++ }
++ else
++#endif
++ {
+ QQuickImageResponse *asyncResponse = asyncResponses.key(job);
+ if (asyncResponse) {
+ asyncResponses.remove(asyncResponse);
+@@ -811,7 +812,6 @@ void QQuickPixmapReader::processJobs()
+ }
+ }
+ PIXMAP_PROFILE(pixmapStateChanged<QQuickProfiler::PixmapLoadingError>(job->url));
+-#endif
+ // deleteLater, since not owned by this thread
+ job->deleteLater();
+ }
+--
+2.45.2
+
=====================================
contrib/src/qtdeclarative/rules.mak
=====================================
@@ -36,6 +36,7 @@ qtdeclarative: qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz .sum
$(UNPACK)
$(APPLY) $(SRC)/qtdeclarative/0001-Fix-incorrect-library-inclusion.patch
$(APPLY) $(SRC)/qtdeclarative/0002-Fix-build-with-no-feature-network.patch
+ $(APPLY) $(SRC)/qtdeclarative/0001-Take-care-of-asyncResponses-when-qml_network-is-disa.patch
# disable unused CLI tools: qml, qmleasing, qmldom, qmlformat, qmltc
sed -i.orig -e 's,add_subdirectory(qml),#add_subdirectory(qml),' $(UNPACK_DIR)/tools/CMakeLists.txt
sed -i.orig -e 's,add_subdirectory(qmleasing),#add_subdirectory(qmleasing),' $(UNPACK_DIR)/tools/CMakeLists.txt
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bece856e7891cce564e966caac332e3a45d38015
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bece856e7891cce564e966caac332e3a45d38015
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