Dec 11, 2015 at 8:18 PM
Edited Dec 11, 2015 at 8:20 PM
Hi Chuck --
After converting my project to UWP version of DirectXTK I ran into a strange runtime exception ("BreakpointException") which occurs without exception details. I confirmed this behavior occurs with UWP and VS2015 using the v140 toolset but not with
More about the exception. It occurs when a C++/CX "ref class" shared across a managed boundary is deallocated, and that class contains a private XMMATRIX member. If I use XMFloat4X4 the object is deallocated without error. I do not need to use the
XMMATRIX member -- it's mere presence in the private section of the C++/CX class header is sufficient to cause an exception when the object destructor is called.
I understand that only primitive types and other ref class types may be shared with managed code. However, I was under the impression that private members which are not part of the public interface could be native C++ types.
Chuck, I consider you an expert and I thought I would share this information with you to see if this could be a bug worth reporting to the compiler team.
Another thought... that this is somehow related to byte alignment issues -- but that raises the question of why this would change in the UWP world with v140 and also how it would apply to private members. I see the same behavior with release vs debug and x86
My workaround is to use XMFloat4x4. Link:
Thank you for your consideration on this unusual behavior. As always, I appreciate your expertise and insight.