Detected memory leaks

前端 未结 5 1720
天涯浪人
天涯浪人 2021-01-30 18:32

In my wxWidgets application, while running in debug mode i got this message in Output of Visual Studio 2010. The application ran fine, and i only saw this after closing it.

5条回答
  •  一整个雨季
    2021-01-30 19:30

    This wiki suggests adding the following to every source file you have, after all other header include's:

    #ifdef __WXMSW__
        #include       // redefines the new() operator 
    #endif
    

    This will result in leaks being reported when your program ends.

    More specifically, make sure you call ->Destroy() on all objects you create using new (except maybe your top window).

提交回复
热议问题