I've made a program in Visual Studio, it's a gui meant to control a camera and the functions of it that my problem rotate about are the functions to open and close the link to the camera. The program seems to run but when I run the program outside visual studio(I double click on it in explorer) and open the camera the release version just closes and the debug version tells me a debug assertion failed,

Expression: _CrtIsValidHeapPointer(pUserData)

I'm not sure how to debug this because it runs fine in visual studio.

I'm kind of stumped and I hoped somebody could nudge me in the right direction based on this information. If I post the relevant code it'll be lengthy and it'll make many references other parts of code, and you might need to know something about pixci cameras.

> Expression: _CrtIsValidHeapPointer(pUserData)
The pointer you passed to realloc / free / delete was not valid.

I don't know why it "works" in the IDE and the debug version outside the IDE doesn't. AFAIK, it should be the same.

But the short of it is you need to start checking your use of dynamic memory. Bear in mind that when you find where the assert is coming from, you've found where it is reported. You've still got to find the root cause of the problem.

Don't you get a "debug" button with the popup assert?