Egor
Egor

Reputation: 809

Memory leak detection on Universal Windows Platform

In my application, I want C++ runtime library to automatically detect memory leaks. In Win32 application, this works perfectly well by adding the following code:

#if defined(_DEBUG) || defined(DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

In Universal Windows Application, this unfortunately has no effect. I tried to call _CrtDumpMemoryLeaks() manually, but I can't really find appropriate place to do this. I would appreciate any suggestions. Thanks!

Upvotes: 2

Views: 573

Answers (1)

Gaurang Dave
Gaurang Dave

Reputation: 4046

Win32 and UWP apps are totally different types of applications so it may happen that some library works on either of the platform.

You can check the memory leaks by running inbuilt memory usage and performance diagnostic tools in Visual Studio. You can collect different memory snapshots and compare them in Memory Tool. Kindly go through this and this for more technical briefing and implementation.

Upvotes: 0

Related Questions