Heap corruption in std::string destructor of plugin?

Hi, I am attempting to write a wrapper plugin to bring in some proprietary C++ plugins into Unreal and seem to be getting heap corruption crashes in the std::string destructor (crashing in ucrtbase.dll with c0000374 error). The exact line is in xmemory0 “::operator delete” but the strange thing is that the std::string that it is crashing on is a class member and is not explicitly free(d) or delete(d).

The C++ dlls are compiled with CMake on Visual Studio 2017 on Windows 10 and work when used in other applications (Max/Maya) so it is unclear why they would be crashing in an Unreal plugin. Is there a “best” way to go about tracking down heap corruptions with Unreal? I am also wondering if there might be a compiler setting that could be causing it to behave differently? Is there a way to log the full compile/linker commands that the Unreal Build Tool uses (without modifying the source)? I have tried linking with the Release or DebugOptimized (from CMake (which is release with .pdb essentially)) but both seem to be causing the same crash.

I saw there was a post where someone else had heap corruptions with std::string ( https://answers.unrealengine.com/questions/550661/view.html ) but don’t think that I can realistically change to char* as was done in that solution.

Thanks for any help.