Hello,
I'm getting the following error message when I try to run my Nunit test cases :
EAccessViolatio n : Access violation at adress 0000000000
I think I narrowed it down to my static method for initializing a critical section.
This is the function :
I'm pretty sure this is causing the violation as that was the only call in the unit test, everything else was in comment.
in the CPP file I also have the following declared:
they're static private members of my class.
Can anyone tell me what I'm doing wrong ?
I'm getting the following error message when I try to run my Nunit test cases :
EAccessViolatio n : Access violation at adress 0000000000
I think I narrowed it down to my static method for initializing a critical section.
This is the function :
Code:
//---------------------------------------------------------------------------
// Initialize the critical section for our DriveManager class as well. This
// allows us to properly create a Singleton instance in a thread-safe
// environment.
// Needs to be called on application startup !
void BigBrother::IO::DriveManager::Initialize()
{
// Initialize the critical section.
::InitializeCriticalSection(&cs_drivemanager);
// Set our flag to true.
BigBrother::IO::DriveManager::initialized = true;
}
in the CPP file I also have the following declared:
Code:
// STATIC VARIABLES --------------------------------------------------------- BigBrother::IO::DriveManager* BigBrother::IO::DriveManager::instance = NULL; volatile bool BigBrother::IO::DriveManager::initialized = false; CRITICAL_SECTION BigBrother::IO::DriveManager::cs_drivemanager; //---------------------------------------------------------------------------
Can anyone tell me what I'm doing wrong ?
Comment