Fix for a crash (I think the same one Zeth reported) where the game dies somewhere in file reading source - I wasn't paying close enough attention to the fact that there are in fact 3 separate caches, so each had their own mutex, so JFileSystem wasn't actually being protected from reentrancy. So, if the app tried to load an audio sample at the same time as an image, boom...

This commit is contained in:
wrenczes@gmail.com
2011-04-20 09:03:08 +00:00
parent fc0a59a14e
commit ec95bb93e1
2 changed files with 9 additions and 10 deletions

View File

@@ -4,7 +4,6 @@
#include "MTGDeck.h"
#include "MTGCard.h"
#include "utils.h"
#include "Threading.h"
#include "WResourceManager.h"
#include "WCachedResource.h"
#include "WFont.h"
@@ -120,11 +119,6 @@ protected:
unsigned int cacheItems;
int mError;
// mutex meant for the cache map
boost::mutex mCacheMutex;
// mutex meant to protect against unthread-safe calls into JFileSystem, etc.
boost::mutex mLoadFunctionMutex;
};
struct WManagedQuad