[fixed] possible 3ds mesh loader bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Dave
Posts: 25
Joined: Wed Mar 28, 2007 11:00 am

[fixed] possible 3ds mesh loader bug

Post by Dave »

I encountered a memory leak (on exiting my application) when using a specific model in my program. The error is as follows:
C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdbg.h(1147) : {15564} normal block at 0x09BB55F0, 2046 bytes long.
Data: < > 00 00 02 00 01 00 03 00 05 00 04 00 06 00 08 00
C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdbg.h(1147) : {15563} normal block at 0x09B8B888, 36828 bytes long.
Data: <K @ Q @ ] ;> 4B C1 9F BF AB C0 40 BF 51 0E 08 40 C0 5D 9D 3B
.\C3DSMeshFileLoader.cpp(939) : {15544} client block at 0x09B4D668, subtype 0, 184 bytes long.
Data: <` ? ? > 60 C9 3F 10 9C C9 3F 10 00 00 00 00 00 00 00 FF
This refers to line 939 in C3DSMeshFileLoader.cpp:

Code: Select all

if (vtxCount>maxPrimitives) 
{ 
        Mesh->addMeshBuffer(new SMeshBuffer()); // <-- this line causes trouble? 
        IMeshBuffer* tmp = mb; 
        mb=(SMeshBuffer*)(Mesh->MeshBuffers[mbPos]=Mesh->MeshBuffers.getLast()); 
        Mesh->MeshBuffers[Mesh->MeshBuffers.size()-1]=tmp; 
        mb->Material=*mat; 
        vtxCount=0; 
} 
As I said, it only happens when I use this model: Jeep model

I don't have any trouble with other models, it's just this one. This makes me believe that this specific model triggers a bug in the mesh loader. Could anyone verify this?

Some info: I use MSVC 2005 to compile under Windows 2000.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

yes, this is a memory leak.. thanks for the model :)

edit: yes, you were correct, the mesh buffer was created with 'new' but not dropped. This is now fixed in svn.. thanks again :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply