• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0

Need help with the last drip of a memory leak

2 posts in this topic

Hey everyone,
I recently adapted code for skinning meshes into my current project, which I took from a book on character animation. But I ran into memory leaks as soon as I tried to import my own character in my own project. The demo code from the book runs fine with my character without ever calling DestroyFrame or DestroyMeshContainer for the BoneHierarchyLoader, to my surprise.
I ran into 212 unfreed allocations and tried to clean it up, which, for example included creating a new function that actually traverses the hierarchy and deletes every bone.
I got it down to two unfreed locations and I cannot pinpoint them. I even used Evil Steve's memory leak checker.

My output (includes the checker output and D3DX output):
(Please notice that only BoneMesh and SkinnedMesh stuff is relevant.)

[source]MEMORY : High watermark was 2699428 bytes (2636KB, 2MB)
MEMORY : Memory leaks detected!
47 active allocations totalling 1408 bytes:
+ ID 00000045, tag ID 0x00000000: 0x008A3E44 160 bytes [thegame.cpp:250 (InitTerrain)]
+ ID 00000393, tag ID 0x00000000: 0x008A427C 44 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000394, tag ID 0x00000000: 0x008A7D44 16 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000404, tag ID 0x00000000: 0x008A4564 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000405, tag ID 0x00000000: 0x008A464C 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000408, tag ID 0x00000000: 0x008A4854 20 bytes [skinnedmesh.cpp:111 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000409, tag ID 0x00000000: 0x008A4944 64 bytes [skinnedmesh.cpp:116 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000410, tag ID 0x00000000: 0x008A4A64 64 bytes [skinnedmesh.cpp:117 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000414, tag ID 0x00000000: 0x008A4DDC 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000415, tag ID 0x00000000: 0x09040244 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000418, tag ID 0x00000000: 0x0904052C 20 bytes [skinnedmesh.cpp:111 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000419, tag ID 0x00000000: 0x0904061C 64 bytes [skinnedmesh.cpp:116 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000420, tag ID 0x00000000: 0x0904073C 64 bytes [skinnedmesh.cpp:117 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000424, tag ID 0x00000000: 0x09040BF4 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000425, tag ID 0x00000000: 0x09040CDC 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000428, tag ID 0x00000000: 0x09040FC4 20 bytes [skinnedmesh.cpp:111 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000429, tag ID 0x00000000: 0x090410B4 64 bytes [skinnedmesh.cpp:116 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000430, tag ID 0x00000000: 0x090411D4 64 bytes [skinnedmesh.cpp:117 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000434, tag ID 0x00000000: 0x0904168C 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000435, tag ID 0x00000000: 0x09041774 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000438, tag ID 0x00000000: 0x09041A5C 20 bytes [skinnedmesh.cpp:111 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000439, tag ID 0x00000000: 0x09041B4C 64 bytes [skinnedmesh.cpp:116 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000440, tag ID 0x00000000: 0x09041C6C 64 bytes [skinnedmesh.cpp:117 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000444, tag ID 0x00000000: 0x09042124 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000445, tag ID 0x00000000: 0x0904220C 8 bytes [??:0 (BoneMesh::BoneMesh)]
+ ID 00000448, tag ID 0x00000000: 0x090424F4 20 bytes [skinnedmesh.cpp:111 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000449, tag ID 0x00000000: 0x090425E4 64 bytes [skinnedmesh.cpp:116 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000450, tag ID 0x00000000: 0x09042704 64 bytes [skinnedmesh.cpp:117 (BoneHierarchyLoader::CreateMeshContainer)]
+ ID 00000451, tag ID 0x00000000: 0x09042824 4 bytes [skinnedmesh.cpp:331 (SkinnedMesh::SetupBoneMatrixPointers)]
+ ID 00000452, tag ID 0x00000000: 0x09042904 4 bytes [skinnedmesh.cpp:331 (SkinnedMesh::SetupBoneMatrixPointers)]
+ ID 00000453, tag ID 0x00000000: 0x090429E4 4 bytes [skinnedmesh.cpp:331 (SkinnedMesh::SetupBoneMatrixPointers)]
+ ID 00000454, tag ID 0x00000000: 0x09042AC4 4 bytes [skinnedmesh.cpp:331 (SkinnedMesh::SetupBoneMatrixPointers)]
+ ID 00000455, tag ID 0x00000000: 0x09042BA4 4 bytes [skinnedmesh.cpp:331 (SkinnedMesh::SetupBoneMatrixPointers)]
+ ID 00000456, tag ID 0x00000000: 0x09042C84 4 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000457, tag ID 0x00000000: 0x09042D64 32 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000459, tag ID 0x00000000: 0x09042F44 44 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000460, tag ID 0x00000000: 0x0904304C 12 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000461, tag ID 0x00000000: 0x09043134 44 bytes [gameobject.cpp:363 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000462, tag ID 0x00000000: 0x0904323C 44 bytes [gameobject.cpp:372 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000463, tag ID 0x00000000: 0x09043344 4 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000464, tag ID 0x00000000: 0x09043424 8 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000466, tag ID 0x00000000: 0x090435F4 44 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000467, tag ID 0x00000000: 0x090436FC 12 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000468, tag ID 0x00000000: 0x090437E4 44 bytes [gameobject.cpp:363 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000469, tag ID 0x00000000: 0x090438EC 44 bytes [gameobject.cpp:372 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000470, tag ID 0x00000000: 0x09042E64 4 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000471, tag ID 0x00000000: 0x090439F4 8 bytes [gameobject.cpp:479 (createBase)]
End of allocations
Memory leaks were foundTheGame (Debug) .exe has triggered a breakpoint
The thread 'Win32 Thread' (0x1140) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x418) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x16c8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xb8c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1028) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x148c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x13f0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1144) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1280) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1500) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1080) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x172c) has exited with code 0 (0x0).
Direct3D9: (ERROR) :Memory still allocated! Alloc count = 185
Direct3D9: (ERROR) :Current Process (pid) = 0000155c
Direct3D9: (ERROR) :Memory Address: 056707fc lAllocID=1 dwSize=00004bc4, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 056753f4 lAllocID=2 dwSize=00000350, ReturnAddr=6b6f02fa (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567577c lAllocID=3 dwSize=00000ef0, ReturnAddr=6b6f6401 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3434c lAllocID=5 dwSize=000242b4, ReturnAddr=6b6fe508 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b58634 lAllocID=6 dwSize=00001bd8, ReturnAddr=6b6eec04 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 056766a4 lAllocID=7 dwSize=000005e0, ReturnAddr=6b6eecd5 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676cbc lAllocID=8 dwSize=00000014, ReturnAddr=6b6eed27 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b10064 lAllocID=12 dwSize=00001950, ReturnAddr=6b6e3cab (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b5a244 lAllocID=13 dwSize=000005e0, ReturnAddr=6b6e3cf1 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676dc4 lAllocID=14 dwSize=00000014, ReturnAddr=6b6e3d3e (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b5a85c lAllocID=15 dwSize=00000350, ReturnAddr=6b6f02fa (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b119ec lAllocID=16 dwSize=00000ef0, ReturnAddr=6b6f6401 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b5abe4 lAllocID=18 dwSize=0001bd28, ReturnAddr=6b6fe508 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b12914 lAllocID=19 dwSize=00001bd8, ReturnAddr=6b6eec04 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b76944 lAllocID=20 dwSize=000005c0, ReturnAddr=6b6eecd5 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b76f3c lAllocID=21 dwSize=00000014, ReturnAddr=6b6eed27 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b14524 lAllocID=23 dwSize=00001950, ReturnAddr=6b6e3cab (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b15eac lAllocID=24 dwSize=000005c0, ReturnAddr=6b6e3cf1 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b76f84 lAllocID=25 dwSize=00000014, ReturnAddr=6b6e3d3e (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676e0c lAllocID=26 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676e84 lAllocID=27 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1682c lAllocID=35 dwSize=00000ef0, ReturnAddr=6b6f6401 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676f0c lAllocID=36 dwSize=00000030, ReturnAddr=6b700881 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b17754 lAllocID=37 dwSize=00001bd8, ReturnAddr=6b6eec04 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b19364 lAllocID=38 dwSize=000005e0, ReturnAddr=6b6eecd5 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676f74 lAllocID=39 dwSize=00000014, ReturnAddr=6b6eed27 (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1997c lAllocID=41 dwSize=00004138, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1daec lAllocID=42 dwSize=00000198, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b164a4 lAllocID=43 dwSize=00000030, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1dcbc lAllocID=44 dwSize=00001020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1ed14 lAllocID=45 dwSize=00000a48, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1650c lAllocID=46 dwSize=00000098, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b165dc lAllocID=47 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1668c lAllocID=48 dwSize=00000024, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b166e4 lAllocID=49 dwSize=00000098, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1f794 lAllocID=50 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b167b4 lAllocID=51 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1f844 lAllocID=52 dwSize=00000024, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1f89c lAllocID=53 dwSize=000000a8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1f97c lAllocID=54 dwSize=00000098, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1fa4c lAllocID=55 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b76fcc lAllocID=56 dwSize=0002b330, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2334 lAllocID=57 dwSize=0000002c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2394 lAllocID=58 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba23f4 lAllocID=59 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba284c lAllocID=60 dwSize=00000030, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba28b4 lAllocID=61 dwSize=00000030, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b1fafc lAllocID=62 dwSize=00001020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba291c lAllocID=63 dwSize=00000120, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2a74 lAllocID=64 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b20b54 lAllocID=65 dwSize=00000e20, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2b0c lAllocID=66 dwSize=00000120, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2c64 lAllocID=67 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b219ac lAllocID=68 dwSize=000003ec, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2cfc lAllocID=69 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2d84 lAllocID=70 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2e0c lAllocID=71 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2e94 lAllocID=72 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2f1c lAllocID=73 dwSize=00000048, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b21dcc lAllocID=74 dwSize=00000054, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b21e54 lAllocID=75 dwSize=00000048, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b21ed4 lAllocID=78 dwSize=000000b8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b21fc4 lAllocID=79 dwSize=00010020, ReturnAddr=6b6ed65a (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3201c lAllocID=80 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b320cc lAllocID=81 dwSize=000000c0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b321c4 lAllocID=82 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b32274 lAllocID=83 dwSize=000000c0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3236c lAllocID=84 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3241c lAllocID=85 dwSize=000000b0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b32504 lAllocID=86 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b325b4 lAllocID=87 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba2f9c lAllocID=88 dwSize=0000002c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3263c lAllocID=89 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3269c lAllocID=90 dwSize=0000002c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05676fbc lAllocID=91 dwSize=0000517c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b326fc lAllocID=92 dwSize=00001020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33754 lAllocID=93 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba3004 lAllocID=94 dwSize=00004020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b337c4 lAllocID=95 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567c16c lAllocID=96 dwSize=0000183c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05ba705c lAllocID=97 dwSize=0000fab8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33834 lAllocID=98 dwSize=00000068, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b338d4 lAllocID=99 dwSize=00000140, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33a4c lAllocID=100 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bb6b4c lAllocID=101 dwSize=00004020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33abc lAllocID=102 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbaba4 lAllocID=103 dwSize=0000183c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33b2c lAllocID=104 dwSize=0000021c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33d7c lAllocID=105 dwSize=00000224, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b33fd4 lAllocID=106 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b34044 lAllocID=107 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b341ac lAllocID=109 dwSize=00000050, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b34234 lAllocID=110 dwSize=00000038, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc414 lAllocID=111 dwSize=00000080, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b342a4 lAllocID=112 dwSize=0000002c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc4cc lAllocID=113 dwSize=00000040, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc544 lAllocID=114 dwSize=00000040, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc5bc lAllocID=115 dwSize=00000040, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc634 lAllocID=116 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc6cc lAllocID=117 dwSize=00000030, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567d9dc lAllocID=118 dwSize=00000b38, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567e54c lAllocID=119 dwSize=00001020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc734 lAllocID=120 dwSize=00000120, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc88c lAllocID=121 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbc924 lAllocID=122 dwSize=00001020, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567f5a4 lAllocID=123 dwSize=00000120, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567f6fc lAllocID=124 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567f794 lAllocID=125 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567fbec lAllocID=126 dwSize=000000e4, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567fd04 lAllocID=127 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bbd97c lAllocID=128 dwSize=000053c0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc2d74 lAllocID=129 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc31cc lAllocID=130 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567fd64 lAllocID=131 dwSize=000001a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0567ff3c lAllocID=133 dwSize=00000040, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc8d24 lAllocID=549 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc917c lAllocID=550 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc9954 lAllocID=553 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc9f04 lAllocID=557 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bca35c lAllocID=558 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bcb06c lAllocID=592 dwSize=00000054, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bcb5f4 lAllocID=593 dwSize=00000080, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0c8fc lAllocID=628 dwSize=00000114, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0ca44 lAllocID=629 dwSize=000003e4, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b340dc lAllocID=630 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0ce5c lAllocID=631 dwSize=00000048, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05b3414c lAllocID=632 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0c60c lAllocID=633 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0cedc lAllocID=634 dwSize=0000003c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0cf4c lAllocID=635 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bca964 lAllocID=643 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0c45c lAllocID=651 dwSize=00000090, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05bc9864 lAllocID=655 dwSize=000000a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0d46c lAllocID=659 dwSize=00000054, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 05c0d4f4 lAllocID=660 dwSize=00000080, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0addcb34 lAllocID=2383 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0addcf8c lAllocID=2384 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0adde96c lAllocID=2462 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0addedc4 lAllocID=2463 dwSize=00000420, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6345c lAllocID=3182 dwSize=000000b8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6354c lAllocID=3183 dwSize=000000a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63624 lAllocID=3184 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae636d4 lAllocID=3185 dwSize=0000005c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63764 lAllocID=3186 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae637dc lAllocID=3187 dwSize=00000024, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63834 lAllocID=3188 dwSize=00000112, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6397c lAllocID=3191 dwSize=000000a8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63a5c lAllocID=3192 dwSize=00000068, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63afc lAllocID=3193 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63bac lAllocID=3194 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63c44 lAllocID=3195 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63cbc lAllocID=3196 dwSize=00000024, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63d14 lAllocID=3197 dwSize=00000112, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63e5c lAllocID=3200 dwSize=000000b8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae63f4c lAllocID=3201 dwSize=000000a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae64024 lAllocID=3202 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae640d4 lAllocID=3203 dwSize=0000005c, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae64164 lAllocID=3204 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae641dc lAllocID=3205 dwSize=00000024, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae64234 lAllocID=3206 dwSize=00000112, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6437c lAllocID=3209 dwSize=000000a8, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6445c lAllocID=3210 dwSize=00000068, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae644fc lAllocID=3211 dwSize=0000007c, ReturnAddr=6b70a22b (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae645ac lAllocID=3212 dwSize=00000060, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae64644 lAllocID=3213 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae646bc lAllocID=3214 dwSize=00000024, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae64714 lAllocID=3215 dwSize=00000112, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0adde3dc lAllocID=3216 dwSize=00000010, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6485c lAllocID=3217 dwSize=000001a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae64a34 lAllocID=3219 dwSize=00000038, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae69144 lAllocID=3343 dwSize=00000054, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae691cc lAllocID=3344 dwSize=00000080, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae699d4 lAllocID=3363 dwSize=00000028, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae69284 lAllocID=3373 dwSize=00000044, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6a1a4 lAllocID=3383 dwSize=00000084, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae69574 lAllocID=3387 dwSize=000001e0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6a48c lAllocID=3391 dwSize=000001e0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6e4b4 lAllocID=3501 dwSize=000001a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6e68c lAllocID=3503 dwSize=00000038, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6e6fc lAllocID=3504 dwSize=00000054, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6e784 lAllocID=3505 dwSize=00000080, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6e83c lAllocID=3506 dwSize=000001a0, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6ea14 lAllocID=3508 dwSize=00000040, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6ed04 lAllocID=3513 dwSize=00000080, ReturnAddr=6b6ed5ea (pid=0000155c)
Direct3D9: (ERROR) :Memory Address: 0ae6edbc lAllocID=3514 dwSize=0000007c, ReturnAddr=6b70b592 (pid=0000155c)
Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 810080 bytes
D3DX: MEMORY LEAKS DETECTED: 2 allocations unfreed (182 bytes)
D3DX: Set HKLM\Software\Microsoft\Direct3D\D3DXBreakOnAllocId=0x10b4 to debug
The program '[5468] TheGame (Debug) .exe: Native' has exited with code 0 (0x0).[/source]

#include <windows.h>
#include <d3dx9.h>
#include <string>
#include <vector>
#include "TriBase.h"
class Camera;
class BoneHierarchyLoader;
using namespace std;

struct Bone: public D3DXFRAME
D3DXMATRIX CombinedTransformationMatrix;

struct BoneMesh: public D3DXMESHCONTAINER
ID3DXMesh* OriginalMesh;
vector<D3DMATERIAL9> materials;
vector<IDirect3DTexture9*> textures;
DWORD NumAttributeGroups;
D3DXMATRIX** boneMatrixPtrs;
D3DXMATRIX* boneOffsetMatrices;
D3DXMATRIX* currentBoneMatrices;

class SkinnedMesh
void Load(char fileName[]);
void Render(Bone *bone);
void RenderStart(Bone *bone, Camera & cam, D3DXMATRIX world);
void SetPose(D3DXMATRIX world, float time);
void SetAnimation(string name);
void GetAnimations(vector<string> &animations);
ID3DXAnimationController* GetController();
void UpdateMatrices(Bone* bone, D3DXMATRIX *parentMatrix);
void SetupBoneMatrixPointers(Bone *bone);
void Destroy(LPD3DXFRAME bone, BoneHierarchyLoader& bh);
D3DXFRAME *m_pRootBone;
ID3DXAnimationController *m_pAnimControl;
ID3DXEffect* m_pEffect;
#endif SKINNED_MESH_H[/source]

[source]#include "skinnedMesh.h"
#include <fstream>
#include "Camera.h"
#pragma warning(disable:4996)
//extern IDirect3DDevice9* g_pDevice;
//extern ID3DXEffect *g_pEffect;
//extern ofstream g_debug;

class BoneHierarchyLoader: public ID3DXAllocateHierarchy
STDMETHOD(CreateMeshContainer)(THIS_ LPCTSTR Name, CONST D3DXMESHDATA * pMeshData, CONST D3DXMATERIAL * pMaterials, CONST D3DXEFFECTINSTANCE * pEffectInstances, DWORD NumMaterials, CONST DWORD * pAdjacency, LPD3DXSKININFO pSkinInfo, LPD3DXMESHCONTAINER * ppNewMeshContainer);
STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree);
STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerBase);

HRESULT BoneHierarchyLoader::CreateFrame(LPCSTR Name, LPD3DXFRAME *ppNewFrame)
Bone *newBone = new Bone;
memset(newBone, 0, sizeof(Bone));

//Copy name
if(Name != NULL)
newBone->Name = new char[strlen(Name)+1];
strcpy(newBone->Name, Name);
//Set the transformation matrices
//Return the new bone...
*ppNewFrame = (D3DXFRAME*)newBone;

return S_OK;

HRESULT BoneHierarchyLoader::CreateMeshContainer(LPCSTR Name,
DWORD NumMaterials,
CONST DWORD *pAdjacency,
//Create new Bone Mesh
BoneMesh *boneMesh = new BoneMesh;
memset(boneMesh, 0, sizeof(BoneMesh));

//Get mesh data
boneMesh->OriginalMesh = pMeshData->pMesh;
boneMesh->MeshData.pMesh = pMeshData->pMesh;
boneMesh->MeshData.Type = pMeshData->Type;
pMeshData->pMesh->AddRef(); //Add Reference so that the mesh isnt deallocated
IDirect3DDevice9 *g_pDevice = NULL;
pMeshData->pMesh->GetDevice(&g_pDevice); //Get g_pDevice ptr from mesh
//Copy materials and load textures (just like with a static mesh)
for(int i=0;i<(int)NumMaterials;i++)
memcpy(&mtrl, &pMaterials[i], sizeof(D3DXMATERIAL));
IDirect3DTexture9* newTexture = NULL;
if(mtrl.pTextureFilename != NULL)
char textureFname[200];
strcpy(textureFname, "_GRAPHICS/");
strcat(textureFname, mtrl.pTextureFilename);
//Load texture
D3DXCreateTextureFromFile(g_pDevice, textureFname, &newTexture);
if(pSkinInfo != NULL)
//Get Skin Info
boneMesh->pSkinInfo = pSkinInfo;
pSkinInfo->AddRef(); //Add reference so that the SkinInfo isnt deallocated

DWORD maxVertInfluences = 0;
DWORD numBoneComboEntries = 0;
ID3DXBuffer* boneComboTable = 0;
0, // ignore adjacency in
0, // ignore adjacency out
0, // ignore face remap
0, // ignore vertex remap

if(boneComboTable != NULL)

//Get Attribute Table
boneMesh->MeshData.pMesh->GetAttributeTable(NULL, &boneMesh->NumAttributeGroups); ################actual line 111#########
boneMesh->attributeTable = new D3DXATTRIBUTERANGE[boneMesh->NumAttributeGroups];
boneMesh->MeshData.pMesh->GetAttributeTable(boneMesh->attributeTable, NULL);

//Create bone offset and current matrices
int NumBones = pSkinInfo->GetNumBones();
boneMesh->boneOffsetMatrices = new D3DXMATRIX[NumBones]; ###########116###########
boneMesh->currentBoneMatrices = new D3DXMATRIX[NumBones]; #########117############

//Get bone offset matrices
for(int i=0;i < NumBones;i++)
boneMesh->boneOffsetMatrices[i] = *(boneMesh->pSkinInfo->GetBoneOffsetMatrix(i));
//Set ppNewMeshContainer to the newly created boneMesh container
*ppNewMeshContainer = boneMesh;

return S_OK;

HRESULT BoneHierarchyLoader::DestroyFrame(LPD3DXFRAME pFrameToFree)
//Free name
if(pFrameToFree->Name != NULL)
delete [] pFrameToFree->Name;
//Free bone
delete pFrameToFree;
pFrameToFree = NULL;
return S_OK;

HRESULT BoneHierarchyLoader::DestroyMeshContainer(LPD3DXMESHCONTAINER pMeshContainerBase)
BoneMesh *boneMesh = (BoneMesh*)pMeshContainerBase;
//Release textures
int numTextures = (int)boneMesh->textures.size();
for(int i=0;i < numTextures;i++)
if(boneMesh->textures[i] != NULL)
//Release mesh data
if(boneMesh->MeshData.pMesh) boneMesh->MeshData.pMesh->Release();
if(boneMesh->pSkinInfo) boneMesh->pSkinInfo->Release();
if(boneMesh->OriginalMesh) boneMesh->OriginalMesh->Release();
delete boneMesh;
return S_OK;

struct VERTEX{
VERTEX(D3DXVECTOR3 pos, D3DCOLOR col){position = pos; color = col;}
D3DXVECTOR3 position;
D3DCOLOR color;
static const DWORD FVF;

m_pRootBone = NULL;
m_pAnimControl = NULL;
m_pEffect = NULL;

BoneHierarchyLoader boneHierarchy;
Destroy(m_pRootBone, boneHierarchy);
if(m_pAnimControl) m_pAnimControl->Release();

void SkinnedMesh::Load(char fileName[])
BoneHierarchyLoader boneHierarchy;
D3DXLoadMeshHierarchyFromX(fileName, D3DXMESH_MANAGED,
tbDirect3D::Instance().GetDevice(), &boneHierarchy,
NULL, &m_pRootBone, &m_pAnimControl);

//Update all the bones
UpdateMatrices((Bone*)m_pRootBone, &i);
//Set up the effect
ID3DXBuffer *pErrorMsgs = NULL;
HRESULT hRes = D3DXCreateEffectFromFile(tbDirect3D::Instance().GetDevice(), "_GRAPHICS/lighting.fx", NULL, NULL, D3DXSHADER_DEBUG, NULL, &m_pEffect, &pErrorMsgs);
if(FAILED(hRes) && (pErrorMsgs != NULL)) //Failed to create Effect
tbWriteToLog( (char*)pErrorMsgs->GetBufferPointer());
MessageBox(tbDirect3D::Instance().GetWindow(), "Fehler beim Erstellen eines .fx!",

void SkinnedMesh::UpdateMatrices(Bone* bone, D3DXMATRIX *parentMatrix)
if(bone == NULL)return;
if(bone->pFrameSibling)UpdateMatrices((Bone*)bone->pFrameSibling, parentMatrix);
if(bone->pFrameFirstChild)UpdateMatrices((Bone*)bone->pFrameFirstChild, &bone->CombinedTransformationMatrix);

void SkinnedMesh::Render(Bone *bone)
if(bone == NULL)bone = (Bone*)m_pRootBone;
//If there is a mesh to render...
if(bone->pMeshContainer != NULL)
BoneMesh *boneMesh = (BoneMesh*)bone->pMeshContainer;
if (boneMesh->pSkinInfo != NULL)
// set up bone transforms
int numBones = boneMesh->pSkinInfo->GetNumBones();
for(int i=0;i < numBones;i++)
D3DXMATRIX view, proj, identity;
m_pEffect->SetMatrixArray("FinalTransforms", boneMesh->currentBoneMatrices, boneMesh->pSkinInfo->GetNumBones());
//Render the mesh
for(int i=0;i < (int)boneMesh->NumAttributeGroups;i++)
int mtrlIndex = boneMesh->attributeTable[i].AttribId;
tbDirect3D::Instance().GetDevice()->SetTexture(0, boneMesh->textures[mtrlIndex]);
//m_pEffect->SetMatrix("matW", &identity);
m_pEffect->SetTexture("texDiffuse", boneMesh->textures[mtrlIndex]);
D3DXHANDLE hTech = m_pEffect->GetTechniqueByName("Skinning");
m_pEffect->Begin(NULL, NULL);
//Normal Static Mesh
m_pEffect->SetMatrix("matW", &bone->CombinedTransformationMatrix);
D3DXHANDLE hTech = m_pEffect->GetTechniqueByName("Lighting");
//Render the mesh
int numMaterials = (int)boneMesh->materials.size();
for(int i=0;i < numMaterials;i++)
m_pEffect->SetTexture("texDiffuse", boneMesh->textures[i]);
m_pEffect->Begin(NULL, NULL);
if(bone->pFrameSibling != NULL)Render((Bone*)bone->pFrameSibling);
if(bone->pFrameFirstChild != NULL)Render((Bone*)bone->pFrameFirstChild);

void SkinnedMesh::RenderStart(Bone *bone, Camera & cam, D3DXMATRIX world)
tbDirect3D& D3D = tbDirect3D::Instance();
D3DXVECTOR4 lightPos(10.0f, 120.0f, 0.0f, 0.0f);
m_pEffect->SetMatrix("matW", &world);
m_pEffect->SetMatrix("matVP", &(cam.view()*cam.proj()));
m_pEffect->SetVector("lightPos", &lightPos);

void SkinnedMesh::SetupBoneMatrixPointers(Bone *bone)
if(bone->pMeshContainer != NULL)
BoneMesh *boneMesh = (BoneMesh*)bone->pMeshContainer;
if(boneMesh->pSkinInfo != NULL)
int NumBones = boneMesh->pSkinInfo->GetNumBones();
boneMesh->boneMatrixPtrs = new D3DXMATRIX*[NumBones]; ############actual line 331##############
for(int i=0;i < NumBones;i++)
Bone *b = (Bone*)D3DXFrameFind(m_pRootBone, boneMesh->pSkinInfo->GetBoneName(i));
if(b != NULL)boneMesh->boneMatrixPtrs[i] = &b->CombinedTransformationMatrix;
else boneMesh->boneMatrixPtrs[i] = NULL;

if(bone->pFrameSibling != NULL)SetupBoneMatrixPointers((Bone*)bone->pFrameSibling);
if(bone->pFrameFirstChild != NULL)SetupBoneMatrixPointers((Bone*)bone->pFrameFirstChild);

void SkinnedMesh::SetPose(D3DXMATRIX world, float time)
m_pAnimControl->AdvanceTime(time, NULL);
UpdateMatrices((Bone*)m_pRootBone, &world);

void SkinnedMesh::SetAnimation(string name)
ID3DXAnimationSet *anim = NULL;
int numAnims = (int)m_pAnimControl->GetMaxNumAnimationSets();
for(int i=0;i<numAnims;i++)
anim = NULL;
m_pAnimControl->GetAnimationSet(i, &anim);
if(anim != NULL)
if(strcmp(name.c_str(), anim->GetName()) == 0)
m_pAnimControl->SetTrackAnimationSet(0, anim);

void SkinnedMesh::GetAnimations(vector<string> &animations)
ID3DXAnimationSet *anim = NULL;
for(int i=0;i<(int)m_pAnimControl->GetMaxNumAnimationSets();i++)
anim = NULL;
m_pAnimControl->GetAnimationSet(i, &anim);
if(anim != NULL)

ID3DXAnimationController* SkinnedMesh::GetController()
ID3DXAnimationController* newAnimController = NULL;
if(m_pAnimControl != NULL)
return newAnimController;

void SkinnedMesh::Destroy(LPD3DXFRAME bone, BoneHierarchyLoader& bh)
if((BoneMesh *) bone->pMeshContainer != NULL)
if(bone->pFrameSibling != NULL) Destroy(bone->pFrameSibling, bh);
if(bone->pFrameFirstChild != NULL) Destroy(bone->pFrameFirstChild, bh);

I've marked some of the code lines from the checker output.

Any ideas what I forgot?

Share this post

Link to post
Share on other sites
you could make use of the class destructor for your BoneMesh structure.
Something like this, It may narrow down the leak.

class BoneMesh[font="Courier New"]: public D3DXMESHCONTAINER[/font]

BoneMesh(){//int all members}
~BoneMesh(){//free all members}

Share this post

Link to post
Share on other sites
First of all: Thank you for replying! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
I changed my BoneMesh in SkinnedMesh.h like this:

[code]struct BoneMesh: public D3DXMESHCONTAINER
ID3DXMesh* OriginalMesh;
vector<D3DMATERIAL9> materials;
vector<IDirect3DTexture9*> textures;
DWORD NumAttributeGroups;
D3DXMATRIX** boneMatrixPtrs;
D3DXMATRIX* boneOffsetMatrices;
D3DXMATRIX* currentBoneMatrices;
delete [] attributeTable;
delete [] boneOffsetMatrices;
delete [] currentBoneMatrices;
delete [] boneMatrixPtrs;
attributeTable = 0;
boneOffsetMatrices = 0;
currentBoneMatrices = 0;
boneMatrixPtrs = 0;

[code]MEMORY : Memory leaks detected!
27 active allocations totalling 652 bytes:
+ ID 00000045, tag ID 0x00000000: 0x01053E44 160 bytes [thegame.cpp:250 (InitTerrain)]
+ ID 00000393, tag ID 0x00000000: 0x0105427C 44 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000394, tag ID 0x00000000: 0x01057D44 20 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000404, tag ID 0x00000000: 0x01054564 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000405, tag ID 0x00000000: 0x0105464C 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000414, tag ID 0x00000000: 0x01054DDC 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000415, tag ID 0x00000000: 0x08E10244 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000424, tag ID 0x00000000: 0x08E10BF4 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000425, tag ID 0x00000000: 0x08E10CDC 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000434, tag ID 0x00000000: 0x08E1168C 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000435, tag ID 0x00000000: 0x08E11774 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000444, tag ID 0x00000000: 0x08E12124 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000445, tag ID 0x00000000: 0x08E1220C 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)]
+ ID 00000456, tag ID 0x00000000: 0x08E12C84 4 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000457, tag ID 0x00000000: 0x08E12D64 32 bytes [gameobject.cpp:459 (createCube)]
+ ID 00000459, tag ID 0x00000000: 0x08E12F44 44 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000460, tag ID 0x00000000: 0x08E1304C 12 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000461, tag ID 0x00000000: 0x08E13134 44 bytes [gameobject.cpp:363 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000462, tag ID 0x00000000: 0x08E1323C 44 bytes [gameobject.cpp:372 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000463, tag ID 0x00000000: 0x08E13344 4 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000464, tag ID 0x00000000: 0x08E13424 8 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000466, tag ID 0x00000000: 0x08E135F4 44 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000467, tag ID 0x00000000: 0x08E136FC 12 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000468, tag ID 0x00000000: 0x08E137E4 44 bytes [gameobject.cpp:363 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000469, tag ID 0x00000000: 0x08E138EC 44 bytes [gameobject.cpp:372 (BaseGraphicsComponent::BaseGraphicsComponent)]
+ ID 00000470, tag ID 0x00000000: 0x08E12E64 4 bytes [gameobject.cpp:479 (createBase)]
+ ID 00000471, tag ID 0x00000000: 0x08E139F4 8 bytes [gameobject.cpp:479 (createBase)]
End of allocations
Memory leaks were foundTheGame (Debug) .exe has triggered a breakpoint
The thread 'Win32 Thread' (0xdf8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xe74) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x112c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xc94) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x118c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1330) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xa30) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x12ac) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x2b8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x13cc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x124c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x828) has exited with code 0 (0x0).
Direct3D9: (ERROR) :Memory still allocated! Alloc count = 189
Direct3D9: (ERROR) :Current Process (pid) = 000013d4
Direct3D9: (ERROR) :Memory Address: 058e07fc lAllocID=1 dwSize=00004bc4, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e53f4 lAllocID=2 dwSize=00000350, ReturnAddr=6bbf02fa (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e577c lAllocID=3 dwSize=00000ef0, ReturnAddr=6bbf6401 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0591434c lAllocID=5 dwSize=000242b4, ReturnAddr=6bbfe508 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05938634 lAllocID=6 dwSize=00001bd8, ReturnAddr=6bbeec04 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e66a4 lAllocID=7 dwSize=000005e0, ReturnAddr=6bbeecd5 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6cbc lAllocID=8 dwSize=00000014, ReturnAddr=6bbeed27 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f0064 lAllocID=12 dwSize=00001950, ReturnAddr=6bbe3cab (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0593a244 lAllocID=13 dwSize=000005e0, ReturnAddr=6bbe3cf1 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6dc4 lAllocID=14 dwSize=00000014, ReturnAddr=6bbe3d3e (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0593a85c lAllocID=15 dwSize=00000350, ReturnAddr=6bbf02fa (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f19ec lAllocID=16 dwSize=00000ef0, ReturnAddr=6bbf6401 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0593abe4 lAllocID=18 dwSize=0001bd28, ReturnAddr=6bbfe508 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f2914 lAllocID=19 dwSize=00001bd8, ReturnAddr=6bbeec04 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05956944 lAllocID=20 dwSize=000005c0, ReturnAddr=6bbeecd5 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05956f3c lAllocID=21 dwSize=00000014, ReturnAddr=6bbeed27 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f4524 lAllocID=23 dwSize=00001950, ReturnAddr=6bbe3cab (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f5eac lAllocID=24 dwSize=000005c0, ReturnAddr=6bbe3cf1 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05956f84 lAllocID=25 dwSize=00000014, ReturnAddr=6bbe3d3e (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6e0c lAllocID=26 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6e84 lAllocID=27 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f682c lAllocID=35 dwSize=00000ef0, ReturnAddr=6bbf6401 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6f0c lAllocID=36 dwSize=00000030, ReturnAddr=6bc00881 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f7754 lAllocID=37 dwSize=00001bd8, ReturnAddr=6bbeec04 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f9364 lAllocID=38 dwSize=000005e0, ReturnAddr=6bbeecd5 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6f74 lAllocID=39 dwSize=00000014, ReturnAddr=6bbeed27 (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f997c lAllocID=41 dwSize=00004138, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058fdaec lAllocID=42 dwSize=00000198, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f64a4 lAllocID=43 dwSize=00000030, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058fdcbc lAllocID=44 dwSize=00001020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058fed14 lAllocID=45 dwSize=00000a48, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f650c lAllocID=46 dwSize=00000098, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f65dc lAllocID=47 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f668c lAllocID=48 dwSize=00000024, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f66e4 lAllocID=49 dwSize=00000098, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ff794 lAllocID=50 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058f67b4 lAllocID=51 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ff844 lAllocID=52 dwSize=00000024, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ff89c lAllocID=53 dwSize=000000a8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ff97c lAllocID=54 dwSize=00000098, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ffa4c lAllocID=55 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05956fcc lAllocID=56 dwSize=0002b330, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982334 lAllocID=57 dwSize=0000002c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982394 lAllocID=58 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059823f4 lAllocID=59 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0598284c lAllocID=60 dwSize=00000030, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059828b4 lAllocID=61 dwSize=00000030, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ffafc lAllocID=62 dwSize=00001020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0598291c lAllocID=63 dwSize=00000120, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982a74 lAllocID=64 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05900b54 lAllocID=65 dwSize=00000e20, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982b0c lAllocID=66 dwSize=00000120, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982c64 lAllocID=67 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059019ac lAllocID=68 dwSize=000003ec, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982cfc lAllocID=69 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982d84 lAllocID=70 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982e0c lAllocID=71 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982e94 lAllocID=72 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982f1c lAllocID=73 dwSize=00000048, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05901dcc lAllocID=74 dwSize=00000054, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05901e54 lAllocID=75 dwSize=00000048, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05901ed4 lAllocID=78 dwSize=000000b8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05901fc4 lAllocID=79 dwSize=00010020, ReturnAddr=6bbed65a (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0591201c lAllocID=80 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059120cc lAllocID=81 dwSize=000000c0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059121c4 lAllocID=82 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05912274 lAllocID=83 dwSize=000000c0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0591236c lAllocID=84 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0591241c lAllocID=85 dwSize=000000b0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05912504 lAllocID=86 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059125b4 lAllocID=87 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05982f9c lAllocID=88 dwSize=0000002c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0591263c lAllocID=89 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0591269c lAllocID=90 dwSize=0000002c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058e6fbc lAllocID=91 dwSize=0000517c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059126fc lAllocID=92 dwSize=00001020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913754 lAllocID=93 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05983004 lAllocID=94 dwSize=00004020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059137c4 lAllocID=95 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ec16c lAllocID=96 dwSize=0000183c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0598705c lAllocID=97 dwSize=0000fab8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913834 lAllocID=98 dwSize=00000068, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059138d4 lAllocID=99 dwSize=00000140, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913a4c lAllocID=100 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05996b4c lAllocID=101 dwSize=00004020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913abc lAllocID=102 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599aba4 lAllocID=103 dwSize=0000183c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913b2c lAllocID=104 dwSize=0000021c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913d7c lAllocID=105 dwSize=00000224, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05913fd4 lAllocID=106 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05914044 lAllocID=107 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059141ac lAllocID=109 dwSize=00000050, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 05914234 lAllocID=110 dwSize=00000038, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c414 lAllocID=111 dwSize=00000080, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059142a4 lAllocID=112 dwSize=0000002c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c4cc lAllocID=113 dwSize=00000040, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c544 lAllocID=114 dwSize=00000040, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c5bc lAllocID=115 dwSize=00000040, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c634 lAllocID=116 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c6cc lAllocID=117 dwSize=00000030, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ed9dc lAllocID=118 dwSize=00000b38, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ee54c lAllocID=119 dwSize=00001020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c734 lAllocID=120 dwSize=00000120, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c88c lAllocID=121 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599c924 lAllocID=122 dwSize=00001020, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ef5a4 lAllocID=123 dwSize=00000120, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ef6fc lAllocID=124 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058ef794 lAllocID=125 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058efbec lAllocID=126 dwSize=000000e4, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058efd04 lAllocID=127 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0599d97c lAllocID=128 dwSize=000053c0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059a2d74 lAllocID=129 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059a31cc lAllocID=130 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058efd64 lAllocID=131 dwSize=000001a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 058eff3c lAllocID=133 dwSize=00000040, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059a8d24 lAllocID=549 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059a917c lAllocID=550 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059a9f04 lAllocID=557 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059aa35c lAllocID=558 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ab06c lAllocID=592 dwSize=00000054, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ab5f4 lAllocID=593 dwSize=00000080, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ed46c lAllocID=659 dwSize=00000054, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ed4f4 lAllocID=660 dwSize=00000080, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0ad2cb34 lAllocID=2383 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0ad2cf8c lAllocID=2384 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0ad2e96c lAllocID=2462 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0ad2edc4 lAllocID=2463 dwSize=00000420, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb345c lAllocID=3182 dwSize=000000b8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb354c lAllocID=3183 dwSize=000000a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3624 lAllocID=3184 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb36d4 lAllocID=3185 dwSize=0000005c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3764 lAllocID=3186 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb37dc lAllocID=3187 dwSize=00000024, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3834 lAllocID=3188 dwSize=00000112, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb397c lAllocID=3191 dwSize=000000a8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3a5c lAllocID=3192 dwSize=00000068, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3afc lAllocID=3193 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3bac lAllocID=3194 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3c44 lAllocID=3195 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3cbc lAllocID=3196 dwSize=00000024, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3d14 lAllocID=3197 dwSize=00000112, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3e5c lAllocID=3200 dwSize=000000b8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb3f4c lAllocID=3201 dwSize=000000a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb4024 lAllocID=3202 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb40d4 lAllocID=3203 dwSize=0000005c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb4164 lAllocID=3204 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb41dc lAllocID=3205 dwSize=00000024, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb4234 lAllocID=3206 dwSize=00000112, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb437c lAllocID=3209 dwSize=000000a8, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb445c lAllocID=3210 dwSize=00000068, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb44fc lAllocID=3211 dwSize=0000007c, ReturnAddr=6bc0a22b (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb45ac lAllocID=3212 dwSize=00000060, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb4644 lAllocID=3213 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb46bc lAllocID=3214 dwSize=00000024, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb4714 lAllocID=3215 dwSize=00000112, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0ad2e3dc lAllocID=3216 dwSize=00000010, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb485c lAllocID=3217 dwSize=000001a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb4a34 lAllocID=3219 dwSize=00000038, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb9144 lAllocID=3343 dwSize=00000054, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb91cc lAllocID=3344 dwSize=00000080, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc2ee4 lAllocID=3600 dwSize=0000018c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc30a4 lAllocID=3601 dwSize=000005c4, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adb967c lAllocID=3602 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ec8fc lAllocID=3603 dwSize=00000048, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adbcf14 lAllocID=3604 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ec97c lAllocID=3605 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc369c lAllocID=3606 dwSize=0000003c, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc370c lAllocID=3607 dwSize=000000a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059ec9dc lAllocID=3608 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc37e4 lAllocID=3609 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc3844 lAllocID=3610 dwSize=00000090, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc390c lAllocID=3611 dwSize=00000044, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc3984 lAllocID=3612 dwSize=000001e0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc3b9c lAllocID=3613 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc3c5c lAllocID=3615 dwSize=00000084, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 059aa964 lAllocID=3623 dwSize=00000028, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc2e64 lAllocID=3633 dwSize=00000038, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc49a4 lAllocID=3638 dwSize=000009d4, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc5f7c lAllocID=3644 dwSize=000009d4, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc2c34 lAllocID=3648 dwSize=00000090, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc2d7c lAllocID=3652 dwSize=00000090, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc5884 lAllocID=3701 dwSize=000001a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0ad6d314 lAllocID=3703 dwSize=00000038, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc5a5c lAllocID=3704 dwSize=00000054, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc5ae4 lAllocID=3705 dwSize=00000080, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc5b9c lAllocID=3706 dwSize=000001a0, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc5d74 lAllocID=3708 dwSize=00000040, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc7124 lAllocID=3713 dwSize=00000080, ReturnAddr=6bbed5ea (pid=000013d4)
Direct3D9: (ERROR) :Memory Address: 0adc71dc lAllocID=3714 dwSize=0000007c, ReturnAddr=6bc0b592 (pid=000013d4)
Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 814560 bytes
D3DX: MEMORY LEAKS DETECTED: 2 allocations unfreed (182 bytes)
D3DX: Set HKLM\Software\Microsoft\Direct3D\D3DXBreakOnAllocId=0x10b4 to debug
The program '[5076] TheGame (Debug) .exe: Native' has exited with code 0 (0x0).[/code]

Allocations from the checker are down by 20! I am not sure, if I delete [b]boneMatrixPtrs [/b]the right way...
[b]+ ID 00000404, tag ID 0x00000000: 0x02824564 8 bytes [skinnedmesh.h:36 (BoneMesh::BoneMesh)][/b]
points to BoneMesh(){}. [b]Why?[/b]
I can provide you a stripped down program, if that would be helpful.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0