[vlc-commits] [Git][videolan/vlc][master] qt: fix cleanup of cache

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 5 15:24:12 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b4b28fcd by Prince Gupta at 2024-01-05T14:28:47+00:00
qt: fix cleanup of cache

reverts 018f4890c161b3d1179771b8fd5f9987f1f172fa
it was not that m_cachedData was deleted (see commit above) but the parent cache
itself was deleted after emitting a signal in its member function

fix: don't instantly clean up the cache in the source when requested
since the requester can be the cache itself.

fixes empty label is not visible in any view
fixes model is always in a loading state

- - - - -


2 changed files:

- modules/gui/qt/util/base_model_p.hpp
- modules/gui/qt/util/listcache.hxx


Changes:

=====================================
modules/gui/qt/util/base_model_p.hpp
=====================================
@@ -83,7 +83,10 @@ protected:
     {
         Q_Q(BaseModel);
         emit q->beginResetModel();
-        cache.reset();
+        // 'abandon' existing cache and queue it for deletion
+        cache->disconnect(q);
+        cache->deleteLater();
+        cache.release();
         emit q->endResetModel();
         validateCache();
     }


=====================================
modules/gui/qt/util/listcache.hxx
=====================================
@@ -482,8 +482,6 @@ void ListCache<T>::asyncCountAndLoad()
                 ? std::min(m_limit, maximumCount)
                 : maximumCount;
 
-            if (queryCount == 0)
-                return;
             //note: should we drop items past queryCount?
             m_cachedData = std::make_unique<CacheData>(std::move(list),
                                                        queryCount,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b4b28fcd44dc96d4e7786c9c6aecd5deb799cfcc

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b4b28fcd44dc96d4e7786c9c6aecd5deb799cfcc
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