Critical error detected c0000374 – C++ dll returns pointer off allocated memory to C#
If all your code is indeed what is shown above, then I don’t see the problem. However, when I get this issue, sometimes its because malloc/new/whatever detects heap corruption, often this corruption has already occurred previously in the program, but the crash has been delayed until the next call to new/malloc. If you read other … Read more