Is anyone using valgrind and Qt?

爱⌒轻易说出口 提交于 2019-11-28 11:56:53

--show-reachable shows memory that hasn't actually leaked, even though valgrind calls it a loss record. Your test app doesn't leak any memory.

You don't need any valgrind suppressions for this particular case. For others, maybe, but you should use valgrind's --gen-suppressions option to generate those suppressions for you.

still reachable: 744 bytes in 7 blocks

If you release QObject o? Do still have the same result?

Update: Just to clarify, this memory will be released by the os when you close the application (so it is not a leak).

However for you own sake it is always good to write a destructor that releases the memory, and it always feels nice to know that you have control over what is allocated and deallocated. (so you don't end up with real memory leaks...)

The above valgrind log reports 0 leaks, i.e. there are no errors.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!