Details
-
Bug
-
Status: Closed
-
P4: Low
-
Resolution: Fixed
-
5.15.2
-
None
-
Qt 5.15.2 and Visual Studio Community 2019 Version16.8.2
-
-
fd839b60a6617a11385326701449fb6825f81eff
Description
When call method QLineEdit::setClearButtonEnabled i got memory leak, for example when using below code:
m_userNameEdit = new QLineEdit(this);
m_userNameEdit>setClearButtonEnabled(true);-
I found this leak when I was checking my application for memory leaks using Visual Studio Community 2019 (Version16.8.2):
Detected memory leaks!
Dumping objects ->
{28250} normal block at 0x00000154A53846F0, 352 bytes long.
Data: < > 01 00 00 00 01 00 00 00 01 00 00 00 03 00 00 00
Object dump complete.
If comment out the line with the method, there will be no leak. To find leaks, I used the following code (in main.cpp):
// Only for Visual studio compliers (detect memory leaks)
#ifdef _MSC_VER
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
...
#ifdef _MSC_VER
// Work only in debug for Visual Studio
// An automatic call to _CrtDumpMemoryLeaks at each exit point
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
Simply load a png file with an icc profile.