Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
b443fb28 by Pierre Lamot at 2024-12-14T06:55:05+00:00
qt: fix assertion in asyncFetchMore when cache tries to recursively refer items
The failling scenario is
* Count&Load task issued (task n°1)
* model need reset (thumbnail is updated for instance) => `needReload = true`
* Count&Load task (n°1) is resolved
* diff util insert/remove rows
* Callback from model change ask to refer an item beyond the cache
* refer issue a new 'fetch more' request (n°2) as m_countTask is 0
* as `needReload == true`, cache is moved to oldCache, new count&load
request
is issued (n° 3)
* task n°2 resolve, cache is null, assertion fails
by moving the `m_countTask` reset after the model update, we ensure that `refer`
won't start a new request while the model is still propagating the update.
- - - - -
1 changed file:
- modules/gui/qt/util/listcache.hxx
Changes:
=====================================
modules/gui/qt/util/listcache.hxx
=====================================
@@ -521,8 +521,6 @@ void ListCache<T>::asyncCountAndLoad()
if (m_countTask != taskId)
return;
- m_countTask = 0;
-
//quite unlikley but model may change between count and load
if (unlikely(list.size() > maximumCount))
{
@@ -556,6 +554,8 @@ void ListCache<T>::asyncCountAndLoad()
emit localSizeChanged(0, m_cachedData->maximumCount);
}
+ m_countTask = 0;
+
if (m_needReload)
{
m_needReload = false;
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/b443fb28911d939990db9ec7d0a0ab1282027995
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/b443fb28911d939990db9ec7d0a0ab1282027995
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits