Hi,<br><br>I have a problem about Memory leak checking, When a class is inherited from a QT class, its memory leak cannot be checked by some tools, such as valgrind, LeakTracer, and cppcheck.<br><br>Here is the code:<br> <br>
file <a.h><br>#ifndef A_H<br>#define A_H<br><br>#include <qwidget.h><br>#include <qpixmap.h><br><br>class A: public QWidget<br>{<br>public:<br> A();<br> ~A();<br>private:<br> int *p;<br>};<br><br>
#endif<br><br><br>file<a.cpp><br>#include"a.h"<br><br>A::A()<br> :QWidget()<br>{<br>p = new int[10];<br>}<br><br>A::~A()<br>{<br>}<br><br><br>file<main.cpp><br>#include<iostream><br>#Include"a.h"<br>
<br>int main()<br>{<br>A a;<br>return 0;<br>}<br><br><br>Then I run qmake -project; qmake; make.<br>Use valgrind, cppcheck and LeakTracer, they all can't trace the memory leak, <br>So I wondered is there any operation done by QT with regard to this?<br>
<br>Thank you!<br><br><br>