Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.0
-
windows 7 x64
visual studio 2010
-
261bbb12003dab0e45b5814f85dd74aa64bcfb79
Description
There is memory leak when using QPushButton under windows vista style, the following code can produce this problem:
int main(int argc, char *argv[])
{ QApplication a(argc, argv); QPushButton w("button"); w.show(); int ret = a.exec(); // memory leak detection int tmp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); tmp |= _CRTDBG_LEAK_CHECK_DF; _CrtSetDbgFlag(tmp); return ret; } Make sure you use windows vista style before run the program, press F5 to start the program, when the push button window is shown, hover the mouse pointer on the push button widget and then close the window, you will see memory leak report in the output window of visual studio. This leak will not occur in the following two cases:
1) you didn't use windows vista style
2) you didn't hover the mouse on the push button widget
BTW: To test the program, I suggest you get the latest code of 4.8 branch from gitorious, this is because a memory leak of font engine object has been fixed a few days ago, if you don't get the latest code, the sample program will also be affected by that memory leak issue, which will confuse you.