]> git.tdb.fi Git - libs/gl.git/commitdiff
Avoid segfaults when LoadingThread's resource is cleared
authorMikko Rasa <tdb@tdb.fi>
Mon, 29 Sep 2014 20:35:16 +0000 (23:35 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 29 Sep 2014 20:35:16 +0000 (23:35 +0300)
source/resourcemanager.cpp

index c9cbcbb713c7126ba54025405e3ec4ccc088424f..999b86c190451dae5a8d33967a3c461c5282862c 100644 (file)
@@ -295,9 +295,12 @@ void ResourceManager::LoadingThread::set_resource(ManagedResource *r)
        }
 
        resource = r;
        }
 
        resource = r;
-       resource->start_loading();
-       state = BUSY;
-       sem.signal();
+       if(resource)
+       {
+               resource->start_loading();
+               state = BUSY;
+               sem.signal();
+       }
 }
 
 void ResourceManager::LoadingThread::sync()
 }
 
 void ResourceManager::LoadingThread::sync()