From: Mikko Rasa Date: Mon, 29 Sep 2014 20:35:16 +0000 (+0300) Subject: Avoid segfaults when LoadingThread's resource is cleared X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=24a5a7e6dced2dbb44be06ca821e9600306b0bfd;p=libs%2Fgl.git Avoid segfaults when LoadingThread's resource is cleared --- diff --git a/source/resourcemanager.cpp b/source/resourcemanager.cpp index c9cbcbb7..999b86c1 100644 --- a/source/resourcemanager.cpp +++ b/source/resourcemanager.cpp @@ -295,9 +295,12 @@ void ResourceManager::LoadingThread::set_resource(ManagedResource *r) } resource = r; - resource->start_loading(); - state = BUSY; - sem.signal(); + if(resource) + { + resource->start_loading(); + state = BUSY; + sem.signal(); + } } void ResourceManager::LoadingThread::sync()