Page 1 of 1

MemLeak with wxWidgets

Posted: Fri Oct 19, 2018 11:43 am
by santajuicylove
I'm using codelite with GNU/g++, wxWidgets-3.1.1 and wxFormBuilder or wxCraftor.
When I run my project with wxWidgets under MemCheck, it always show many memory Leaks,even the project is auto genarate by ide.
For console application, no memory leak detected.
I want to know why.

Re: MemLeak with wxWidgets

Posted: Fri Oct 19, 2018 1:21 pm
by DavidGH
Hi,

Memcheck uses Valgrind, which always outputs large numbers of false-positive leaks with wxWidgets code; see e.g.
this wxwiki page (which I must remember to update).

I'd say you have 3 choices:
  • 1) Look through the supposed leaks. Fix any that really come from your code bugs, and allow Memcheck to add the rest to its suppression file.
    2) Add a separate suppression file; then goto 1)
    3) Use Valgrind directly instead of via Memcheck.
Regards,

David