wx osg memory leak Topic is solved

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
schoonmoeder
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Feb 01, 2007 12:03 pm
Location: netherlands

wx osg memory leak

Post by schoonmoeder » Mon Feb 26, 2007 6:47 pm

im trying to get wxosgcanvastest to work i'm getting no error's when compilling only some warnings.

but when i try to open a file i get an memory leak
Detected memory leaks!
Dumping objects ->


the piece of code i think gives the error are

Code: Select all

wxFileDialog dialog(this, "Choose File to Open", defaultDir, defaultFile, wildcard, style);
	dialog.ShowModal();

	//
	// initialise scene
	//
	if (!osgCanvas_->init(dialog.GetPath())) {
		exit(1);
	}
and

Code: Select all

bool wxOsgCanvas::init(const wxString &filename)
{
	// make sure we have an OpenGL context
	SetCurrent();

	// create event queue and handlers
	eventQueue_ = new osgGA::EventQueue(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS);
	actionAdapter_ = new DefaultActionAdapter;

	// load model
	//	- must be valid
	osg::ref_ptr<osg::Node> model = osgDB::readNodeFile(filename.c_str());
	if (!model) {
		return false;
	}
'wxOsgCanvasTest.exe': Loaded 'C:\Documents and Settings\Ewart ten Brink\Bureaublad\afstuderen\Product\research\code\wxWidgets\wxOsgCanvas-0.2\DebugMSW\wxOsgCanvasTest.exe', Symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\Documents and Settings\Ewart ten Brink\Bureaublad\afstuderen\Product\research\code\wxWidgets\wxOsgCanvas-0.2\DebugMSW\osgd.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\Documents and Settings\Ewart ten Brink\Bureaublad\afstuderen\Product\research\code\wxWidgets\wxOsgCanvas-0.2\DebugMSW\OpenThreadsWin32d.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcp80d.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\Documents and Settings\Ewart ten Brink\Bureaublad\afstuderen\Product\research\code\wxWidgets\wxOsgCanvas-0.2\DebugMSW\osgDBd.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\Documents and Settings\Ewart ten Brink\Bureaublad\afstuderen\Product\research\code\wxWidgets\wxOsgCanvas-0.2\DebugMSW\osgGAd.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\Documents and Settings\Ewart ten Brink\Bureaublad\afstuderen\Product\research\code\wxWidgets\wxOsgCanvas-0.2\DebugMSW\osgUtild.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\comdlg32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\lpk.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\MSCTF.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\SynTPFcs.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\atioglxx.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\clbcatq.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\comres.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\cscui.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\cscdll.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\browseui.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\userenv.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\ntshrui.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\atl.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\netapi32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\shdocvw.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\cryptui.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\wintrust.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\wininet.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\normaliz.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\iertutil.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\wldap32.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\riched20.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Unloaded 'C:\WINDOWS\system32\riched20.dll'
'wxOsgCanvasTest.exe': Loaded 'C:\WINDOWS\system32\xpsp2res.dll', Binary was not built with debug information.
'wxOsgCanvasTest.exe': Loaded 'C:\Program Files\Adobe\Acrobat 7.0\ActiveX\pdfshell.dll', No symbols loaded.
'wxOsgCanvasTest.exe': Unloaded 'C:\Program Files\Adobe\Acrobat 7.0\ActiveX\pdfshell.dll'
Detected memory leaks!
Dumping objects ->
{1528} normal block at 0x01BC1EA8, 20 bytes long.
Data: <\eh Teh > 5C 65 68 00 54 65 68 00 00 00 00 00 01 00 00 00
{1527} normal block at 0x01BC3490, 64 bytes long.
--- ect ect ect ---
{611} normal block at 0x01BB28C8, 160 bytes long.
Data: < c:\D> 01 00 00 00 8C 00 00 00 93 00 00 00 63 3A 5C 44
Object dump complete.
The thread 'Win32 Thread' (0x904) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0xfc4) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0xc50) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0x510) has exited with code 1 (0x1).
The program '[2532] wxOsgCanvasTest.exe: Native' has exited with code 1 (0x1).
thnx in advanced just ask for any code or awnsers you want i will appriciate all help.
im compiling latest osg and wxWidgets 1.8.0
Microsoft visual c++ express edition windows XP

Ewart ten Brink

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: wx osg memory leak

Post by Auria » Mon Feb 26, 2007 11:52 pm

schoonmoeder wrote:wxWidgets 1.8.0
This is a typo, right? :lol:

Well i have no idea if you're a beginner so pardon me if you're not and i'm repeating basic stuff, but the only 2 objects allocated by your code in this snippet are:

eventQueue_ = new osgGA::EventQueue(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS);
actionAdapter_ = new DefaultActionAdapter;

Do you delete them?

schoonmoeder
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Feb 01, 2007 12:03 pm
Location: netherlands

Post by schoonmoeder » Tue Feb 27, 2007 11:39 am

they are deleted further on in the code.

i just worked on a newer version. hope that one will get no memory leak.

Post Reply