mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 10:38:34 +02:00
Protect against missing texture cache on shutdown
This commit is contained in:
parent
a41146451b
commit
5e716f15b5
1 changed files with 6 additions and 2 deletions
|
@ -189,9 +189,13 @@ NetworkTexturePointer TextureCache::getTexture(const QUrl& url, Type type, const
|
|||
}
|
||||
|
||||
gpu::TexturePointer getFallbackTextureForType(NetworkTexture::Type type) {
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
|
||||
gpu::TexturePointer result;
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
// Since this can be called on a background thread, there's a chance that the cache
|
||||
// will be destroyed by the time we request it
|
||||
if (!textureCache) {
|
||||
return result;
|
||||
}
|
||||
switch (type) {
|
||||
case NetworkTexture::DEFAULT_TEXTURE:
|
||||
case NetworkTexture::ALBEDO_TEXTURE:
|
||||
|
|
Loading…
Reference in a new issue