Hi,
sorry for responding lately - I was on vacation this week.
We've had complaints on Obj memory leaks earlier. I'm CCing to kimmi, he maintains the Obj loader to assimp.
Bye, Alex
-------- Original-Nachricht --------
> Datum: Fri, 21 Sep 2012 02:07:20 +0200
> Von: Axel Blackert <axel.blackert@gmail.com>
> An: alexander.gessler@gmx.net
> Betreff: Assimp .obj importer memory leaks
> Hey there! I've started using Assimp and it's really nice! However I have
> discovered that it has a memory leak in the .obj importer code. I don't
> know if I'm forgetting to do some releasing of the scene or if it
> acctually
> is a real leak.
>
> I'm using C++ on a Windows machine.
>
> Here's the output from Visual Leak Detector:
>
> WARNING: Visual Leak Detector detected memory leaks!
> >
> > ---------- Block 714 at 0x007A68C8: 7248 bytes ----------
> >
> > Call Stack:
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfileparser.cpp
> >> (74): Graphics Library.exe!Assimp::ObjFileParser::ObjFileParser + 0xA
> bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfileimporter.cpp
> >> (145): Graphics Library.exe!Assimp::ObjFileImporter::InternReadFile +
> 0x1D
> >> bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\baseimporter.cpp
> >> (88): Graphics Library.exe!Assimp::BaseImporter::ReadFile + 0x2C bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\importer.cpp
> >> (650): Graphics Library.exe!Assimp::Importer::ReadFile + 0x18 bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\include\assimp\importer.hpp
> >> (629): Graphics Library.exe!Assimp::Importer::ReadFile
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\common\modelimporter.cpp (55): Graphics
> >> Library.exe!ModelImporter::LoadModel + 0x11 bytes
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\common\object3d.cpp (15): Graphics
> >> Library.exe!Object3D::Object3D + 0x22 bytes
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\game.cpp (84): Graphics Library.exe!Game::Init
> +
> >> 0x50 bytes
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\game.cpp (49): Graphics Library.exe!WinMain
> >
> > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (529): Graphics
> >> Library.exe!__tmainCRTStartup + 0x15 bytes
> >
> > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (378): Graphics
> >> Library.exe!WinMainCRTStartup
> >
> > 0x747B3677 (File and line number not available):
> >> kernel32.dll!BaseThreadInitThunk + 0x12 bytes
> >
> > 0x77009F42 (File and line number not available):
> >> ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes
> >
> > 0x77009F15 (File and line number not available):
> >> ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes
> >
> > Data:
> >
> > 0F 00 00 00 44 65 66 61 75 6C 74 4D 61 74 65 72
> ....Defa
> >> ultMater
> >
> > 69 61 6C 00 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ial.....
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> >
> >>
> >> ---------- Block 750 at 0x007A8D70: 7248 bytes ----------
> >
> > Call Stack:
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfilemtlimporter.cpp
> >> (240): Graphics Library.exe!Assimp::ObjFileMtlImporter::createMaterial
> +
> >> 0xA bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfilemtlimporter.cpp
> >> (164): Graphics Library.exe!Assimp::ObjFileMtlImporter::load
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfilemtlimporter.cpp
> >> (69): Graphics
> Library.exe!Assimp::ObjFileMtlImporter::ObjFileMtlImporter
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfileparser.cpp
> >> (475): Graphics Library.exe!Assimp::ObjFileParser::getMaterialLib
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfileparser.cpp
> >> (160): Graphics Library.exe!Assimp::ObjFileParser::parseFile
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfileparser.cpp
> >> (81): Graphics Library.exe!Assimp::ObjFileParser::ObjFileParser
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\objfileimporter.cpp
> >> (145): Graphics Library.exe!Assimp::ObjFileImporter::InternReadFile +
> 0x1D
> >> bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\baseimporter.cpp
> >> (88): Graphics Library.exe!Assimp::BaseImporter::ReadFile + 0x2C bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\code\importer.cpp
> >> (650): Graphics Library.exe!Assimp::Importer::ReadFile + 0x18 bytes
> >
> >
> >>
> c:\users\axel\documents\programmering\assimp--3.0.1270-sdk\include\assimp\importer.hpp
> >> (629): Graphics Library.exe!Assimp::Importer::ReadFile
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\common\modelimporter.cpp (55): Graphics
> >> Library.exe!ModelImporter::LoadModel + 0x11 bytes
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\common\object3d.cpp (15): Graphics
> >> Library.exe!Object3D::Object3D + 0x22 bytes
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\game.cpp (84): Graphics Library.exe!Game::Init
> +
> >> 0x50 bytes
> >
> > f:\users\axel\documents\visual studio 11\projects\graphics
> >> library\graphics library\game.cpp (49): Graphics Library.exe!WinMain
> >
> > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (529): Graphics
> >> Library.exe!__tmainCRTStartup + 0x15 bytes
> >
> > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (378): Graphics
> >> Library.exe!WinMainCRTStartup
> >
> > 0x747B3677 (File and line number not available):
> >> kernel32.dll!BaseThreadInitThunk + 0x12 bytes
> >
> > 0x77009F42 (File and line number not available):
> >> ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes
> >
> > 0x77009F15 (File and line number not available):
> >> ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes
> >
> > Data:
> >
> > 0D 00 00 00 41 73 73 61 73 73 69 6E 5F 42 6F 64
> ....Assa
> >> ssin_Bod
> >
> > 79 00 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> y.......
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> > 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B
> ........
> >> ........
> >
> >
> Thanks for your time,
>
> // Axel
Just do it!
see: https://github.com/assimp/assimp/issues/118