Is there any way to detect where/when a heap corruption has occurred, when running a plugin in the debugger in Visual Studio (2019)?
I have a VST3 plugin that works fine on Mac, but when closing the plugin on the PC, it crashes in ntdll with a message about a heap corruption. I tried turning on “Enable Diagnostic Tools when debugging”, and “Enable Windows debug heap allocator”, and once running I enabled “heap profiling”, but don’t see anything in the Output window or in any of the debugger windows when running, and the code hits the exception when there is nothing related to my plugin in the call stack.
I also tried selecting “Enable native corruption detection” in the Diagnostic Tools’ Memory Profiler Tool, but again I don’t see anything in the Output window or diagnostic windows to tell me when/where the heap corruption happened; only that it breaks in ntdll, which has no source code available, naturally.
I’ve tried Google searches and looking at posts here (including mine from a previous similar experience), but everything seems to talk about how to deal with heap corruption in an executable, not in a dll. I’m at a loss as to how to locate this heap corruption which only seems to happen on Windows (even though I don’t have any code other than inside the JUCE library itself that differs between Mac and PC).
Any ideas? I’ve combed through my code for a couple of weeks now, improving things here and there, but this problem persists.