A
Adam Clauss
I have an unmanaged C++ library that I need to use through C#. I created a
Managed C++ class library and through it wrote a wrapper class to call what
I need.
However, one of the methods (an Initialize function in the unmanaged
library) crashes everytime I call it. Initialize calls another function
'GetInstance' (a static member function of a class) which looks something
like:
CLibConfig& CLibConfig::GetInstance()
{
//Our instance (to avoid singleton problems!)
static CLibConfig sInstance; <--------
//Return it
return sInstance;
}
It is on the static sInstance line that I get a debug assertion.
in dbheap.c, Line1291.
_CrtIsValidHeapPointer(pUserData).
The static line is the last line from the call stack within the C++ library,
from there it goes into the C runtime. Any suggestions?
Managed C++ class library and through it wrote a wrapper class to call what
I need.
However, one of the methods (an Initialize function in the unmanaged
library) crashes everytime I call it. Initialize calls another function
'GetInstance' (a static member function of a class) which looks something
like:
CLibConfig& CLibConfig::GetInstance()
{
//Our instance (to avoid singleton problems!)
static CLibConfig sInstance; <--------
//Return it
return sInstance;
}
It is on the static sInstance line that I get a debug assertion.
in dbheap.c, Line1291.
_CrtIsValidHeapPointer(pUserData).
The static line is the last line from the call stack within the C++ library,
from there it goes into the C runtime. Any suggestions?