Clear CacheHelper::waiting mutex in time.
I hope this fixes crashes in streaming semaphore usage. CacheHelper::waiting points to Context::_semaphore, so it should be cleared before Context is destroyed, not later.
This commit is contained in:
parent
a14dbffb65
commit
3c931b11d6
|
@ -903,6 +903,10 @@ void Reader::stopStreaming(bool stillActive) {
|
||||||
|
|
||||||
_stopStreamingAsync = false;
|
_stopStreamingAsync = false;
|
||||||
_waiting.store(nullptr, std::memory_order_release);
|
_waiting.store(nullptr, std::memory_order_release);
|
||||||
|
if (_cacheHelper && _cacheHelper->waiting != nullptr) {
|
||||||
|
QMutexLocker lock(&_cacheHelper->mutex);
|
||||||
|
_cacheHelper->waiting.store(nullptr, std::memory_order_release);
|
||||||
|
}
|
||||||
if (!stillActive) {
|
if (!stillActive) {
|
||||||
_streamingActive = false;
|
_streamingActive = false;
|
||||||
refreshLoaderPriority();
|
refreshLoaderPriority();
|
||||||
|
@ -1379,10 +1383,6 @@ void Reader::finalizeCache() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Assert(_cache != nullptr);
|
Assert(_cache != nullptr);
|
||||||
if (_cacheHelper->waiting != nullptr) {
|
|
||||||
QMutexLocker lock(&_cacheHelper->mutex);
|
|
||||||
_cacheHelper->waiting.store(nullptr, std::memory_order_release);
|
|
||||||
}
|
|
||||||
auto toCache = _slices.unloadToCache();
|
auto toCache = _slices.unloadToCache();
|
||||||
while (toCache.number >= 0) {
|
while (toCache.number >= 0) {
|
||||||
putToCache(std::move(toCache));
|
putToCache(std::move(toCache));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user