diff --git a/modules/gui/qt/util/base_model_p.hpp b/modules/gui/qt/util/base_model_p.hpp index db73bb3b63..81ddb65304 100644 --- a/modules/gui/qt/util/base_model_p.hpp +++ b/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(); } diff --git a/modules/gui/qt/util/listcache.hxx b/modules/gui/qt/util/listcache.hxx index 3ae0d8cd2f..0442c0f7b2 100644 --- a/modules/gui/qt/util/listcache.hxx +++ b/modules/gui/qt/util/listcache.hxx @@ -482,8 +482,6 @@ void ListCache::asyncCountAndLoad() ? std::min(m_limit, maximumCount) : maximumCount; - if (queryCount == 0) - return; //note: should we drop items past queryCount? m_cachedData = std::make_unique(std::move(list), queryCount,