Without a callstack and the actual crash message it is impossible to say what happened. That being said, it looks like mutex is a pointer to a critical section - did you actually create an instance? Perhaps the pointer is still null or invalid, and dereferencing it in mutex-lock() causes the crash?
By the way, the most convenient way to use critical sections is in conjunction with scope locks:
class FStreamingContext
{
FCriticalSection CriticalSection; // <-- not a pointer, but an actual instance!
}
void FStreamingContext::Lock()
{
// unprotected things here...
{
FScopeLock Lock(&CriticalSection);
// do protected things here...
}
// unprotected things here...
}
i know its been years but for people who have this problem i think this is a better solution than global mutex source
mutable FCriticalSection DataGuard;