wxWidgets with a Memory Leak Detector (such as MMGR)

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
simotix
Experienced Solver
Experienced Solver
Posts: 53
Joined: Fri May 29, 2009 5:24 am

wxWidgets with a Memory Leak Detector (such as MMGR)

Post by simotix » Mon Feb 15, 2010 5:41 am

I often use a memory leak dection system with my code as a "just in case" measure for detecting leaks. However, the one I commonly use (MMGR) seems to be tripping on wxWidgets code that it does not appreciate.

There will eventually be a "delete wxLog::SetActiveTarget(NULL);" in init.cpp through a main entry (wxEntry, from IMPLEMENT_APP.

My question is, does anyone know how to get MMGR to work with wxWidgets or know of a different memory leak detection system that works with windows (that works on VS2005\Vista).

Just for kicks, here is my basic code

[source]
#include "wx/wx.h"
#include "External\MMGR\mmgr.h"

class HelloWorldApp : public wxApp
{
public:
virtual bool OnInit();
};

IMPLEMENT_APP(HelloWorldApp)

bool HelloWorldApp::OnInit()
{
wxFrame *frame = new wxFrame(NULL, -1, argv[0]);

frame->Show(TRUE);

SetTopWindow(frame);

return true;
}
[/source]

orbitcowboy
I live to help wx-kind
I live to help wx-kind
Posts: 178
Joined: Mon Jul 23, 2007 9:01 am

Post by orbitcowboy » Mon Feb 15, 2010 6:13 am

i use cppcheck, it finds resource, memory leaks and more:

http://sourceforge.net/projects/cppcheck/
OS: Ubuntu 9.04 (32/64-Bit), Debian Lenny (32-Bit)
Compiler: gcc/g++-4.3.3 , gcc/g++-4.4.0
wxWidgets: 2.8.10,2.9.0

TrV
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 630
Joined: Wed Jul 04, 2007 1:12 pm

Post by TrV » Mon Feb 15, 2010 7:34 am

Does anyone know where to get CppCheck plugin for Code::Blocks? Everyone is talking about it, but can't find where to download it...

jfouche
Super wx Problem Solver
Super wx Problem Solver
Posts: 442
Joined: Tue May 06, 2008 4:52 pm
Location: France

Post by jfouche » Mon Feb 15, 2010 1:10 pm

Use CodeLite :)
If you still want to use Code::Blocks, it's available since the 02 juanary nighty build.
Jérémie

TrV
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 630
Joined: Wed Jul 04, 2007 1:12 pm

Post by TrV » Mon Feb 15, 2010 1:35 pm

jfouche, crawling the web i've seen you are more or less related (don't know how much) with cppcheck for codelite.

I've already tested codelite and greatly appreciated it (just a 30 minute test), but never changed since i've nothing to say against code::blocks...

CppCheck is included with nightly build... marvellous, i understand now.
Thank you very much for the information ;)

Post Reply