mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- bugfix for mod menu segfault when user clicks like mad
This commit is contained in:
parent
6967f23a92
commit
98a3c5e699
@ -1662,9 +1662,22 @@ void MenuStateMods::showDesription(const ModInfo *modInfo) {
|
|||||||
string tempImage = getPreviewImageFileForMod(modInfo);
|
string tempImage = getPreviewImageFileForMod(modInfo);
|
||||||
if(tempImage != "" && fileExists(tempImage) == false) {
|
if(tempImage != "" && fileExists(tempImage) == false) {
|
||||||
if(ftpClientThread != NULL) ftpClientThread->addFileToRequests(tempImage,modInfo->imageUrl);
|
if(ftpClientThread != NULL) ftpClientThread->addFileToRequests(tempImage,modInfo->imageUrl);
|
||||||
|
|
||||||
|
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),mutexOwnerId);
|
||||||
|
if(ftpClientThread != NULL && ftpClientThread->getProgressMutex() != NULL) ftpClientThread->getProgressMutex()->setOwnerId(mutexOwnerId);
|
||||||
|
fileFTPProgressList[tempImage] = pair<int,string>(0,"");
|
||||||
|
safeMutexFTPProgress.ReleaseLock();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
displayModPreviewImage = true;
|
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),mutexOwnerId);
|
||||||
|
if(ftpClientThread != NULL && ftpClientThread->getProgressMutex() != NULL) ftpClientThread->getProgressMutex()->setOwnerId(mutexOwnerId);
|
||||||
|
if(fileFTPProgressList.find(tempImage) == fileFTPProgressList.end()) {
|
||||||
|
displayModPreviewImage = true;
|
||||||
|
}
|
||||||
|
safeMutexFTPProgress.ReleaseLock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user