And even so far I had no Problems when using Debug/x64, Release/x64, Debug/x32.

Even when I was using Release/x32 it worked perfectly when I turned off optimization (/Od).

As soon as I turned on optimization in any form (/O1, /O2, /Ox) it crashes.

I was able to locate the point of crash: Sometimes it crashes when the QuadTree is created (using the new-operator), sometimes it crashes when the QuadTree is split (allocating child-nodes, using the new-operator).

In both cases the new-operator calls malloc. After the execution of malloc (debugging malloc is difficult, using optimization, so I can't tell you where exactly in the malloc-function) the this-pointer of the calling-method is messed up (somtimes it points
to nullptr, sometimes to 0x3, ....). Of course the next access of this pointer then results in an access-voilation(-exception)

The only thing I additionaly changed (in C++- & Linker-options) since creating the program was to disable precompiled header files.

I'm suspecting heap corruption, but since the program runs perfectly, if I don't use the quad-tree or if I turn off optimization, or if I switch to x64, ..., and I am using the new-operator in other places as well, I really have no idea where to start looking.