Qt信号和插槽中的内存泄漏

时间:2010-03-16 05:45:12

标签: c++ qt memory-leaks qt-signals

我在我的Qt代码上运行valgrind,即使成功退出应用程序,我也会收到valgrind的以下报告:

8,832 bytes in 92 blocks are still reachable in loss record 12 of 12<br>      
at 0x4025390: operator new(unsigned int) (vg_replace_malloc.c:214)<br>
==3339==    by 0x4B75F05: QMutex::QMutex(QMutex::RecursionMode) (qmutex.cpp:123)
==3339==    by 0x4B77602: QMutexPool::get(void const*) (qmutexpool.cpp:137)<br>
==3339==    by 0x4CA0EC2: signalSlotLock(QObject const*) (qobject.cpp:112)<br>
==3339==    by 0x4CA3939: QMetaObjectPrivate::connect(QObject const*, int, QObject const*, int, int, int*) (qobject.cpp:2900)<br>
==3339==    by 0x4CA5C00: QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (qobject.cpp:2599)

我断开所有信号连接并删除对象。如果我增加信号和插槽连接的数量,上述泄漏会增加。

有人可以帮忙吗?

0 个答案:

没有答案