why is a scalar deleting destructor being called as a result of vector delete on Windows?

前端 未结 5 1671
时光说笑
时光说笑 2021-01-05 16:56

I have a code that is leaking on Windows. It runs fine on many unix platforms and the leak only occurs on Windows. The binary consists of exe, 1 dll and 2 static libs. The e

5条回答
  •  [愿得一人]
    2021-01-05 17:44

    This is an old Problem in VC++ regarding DLLs and Object-Arrays. The cause is an incorrect compiler optimization as explained by Microsoft.

    http://support.microsoft.com/kb/121216/en-us

    Better use the STL-containers which dont have the problem due to the use of allocator.

提交回复
热议问题