Sign in to follow this  
cugone

Tracing Memory Leaks?

Recommended Posts

After commenting out everything except the d3d and d3ddevice code, i.e., the window is drawn, one frame is rendered with nothing, then the window is closed I still have 2 memory leaks (it's better than the ONE-THOUSAND that occur when the full code is run!). I'd like to learn how to trace them to some kind of source and plug them, but I don't know how. Any suggestions? Debug output follows: Most important part:
Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 1820677 bytes
Direct3D9: :====> EXIT: DLLMAIN(65afa170): Process Detach 00000db0
D3DX: MEMORY LEAKS DETECTED: 2 allocations unfreed (448 bytes)

Probably important, but since I don't know what I'm looking for when it IS turned on, it's not helpful:
D3DX: Set HKLM\Software\Microsoft\Direct3D\D3DXBreakOnAllocId=0x1 to debug

*WARNING* Full Text follows: *WARNING*
Direct3D9: :====> ENTER: DLLMAIN(65afa170): Process Detach 00000db0, tid=00000d2c
Direct3D9: (INFO) :MemFini!
Direct3D9: (ERROR) :Memory still allocated!  Alloc count = 169
Direct3D9: (ERROR) :Current Process (pid) = 00000db0
Direct3D9: (ERROR) :Memory Address: 000f07f4 lAllocID=1 dwSize=00004bc4, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f53ec lAllocID=2 dwSize=0000031c, ReturnAddr=65afc90a (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f573c lAllocID=3 dwSize=00000c28, ReturnAddr=65b029d1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8913c lAllocID=5 dwSize=000190a4, ReturnAddr=65b0a268 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02da2214 lAllocID=6 dwSize=00001b6c, ReturnAddr=65afb244 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f639c lAllocID=7 dwSize=00000780, ReturnAddr=65afb2d1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f6b54 lAllocID=8 dwSize=00000008, ReturnAddr=65afb32a (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d70064 lAllocID=12 dwSize=000018e4, ReturnAddr=65aefd1b (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02da3db4 lAllocID=13 dwSize=00000780, ReturnAddr=65aefd61 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f6c54 lAllocID=14 dwSize=00000008, ReturnAddr=65aefdb1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f6c94 lAllocID=15 dwSize=0000031c, ReturnAddr=65afc90a (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7197c lAllocID=16 dwSize=00000c28, ReturnAddr=65b029d1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbd644 lAllocID=18 dwSize=000190a4, ReturnAddr=65b0a268 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd671c lAllocID=19 dwSize=00001b6c, ReturnAddr=65afb244 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd82bc lAllocID=20 dwSize=00000780, ReturnAddr=65afb2d1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8a74 lAllocID=21 dwSize=00000008, ReturnAddr=65afb32a (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d725dc lAllocID=23 dwSize=000018e4, ReturnAddr=65aefd1b (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d73ef4 lAllocID=24 dwSize=00000780, ReturnAddr=65aefd61 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8ab4 lAllocID=25 dwSize=00000008, ReturnAddr=65aefdb1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8af4 lAllocID=26 dwSize=00000044, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8b6c lAllocID=27 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d746ac lAllocID=29 dwSize=00000c28, ReturnAddr=65b029d1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8f44 lAllocID=30 dwSize=00000020, ReturnAddr=65b0c32c (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7530c lAllocID=31 dwSize=00001b6c, ReturnAddr=65afb244 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d76eac lAllocID=32 dwSize=00000780, ReturnAddr=65afb2d1 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8f9c lAllocID=33 dwSize=00000008, ReturnAddr=65afb32a (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d77664 lAllocID=35 dwSize=00003ea8, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7b544 lAllocID=36 dwSize=00000198, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8bf4 lAllocID=37 dwSize=00000030, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7b714 lAllocID=38 dwSize=00001020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7c76c lAllocID=39 dwSize=00000858, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8c5c lAllocID=40 dwSize=00000098, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8d2c lAllocID=41 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8ddc lAllocID=42 dwSize=00000024, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8e34 lAllocID=43 dwSize=00000098, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7cffc lAllocID=44 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7d0ac lAllocID=45 dwSize=00000044, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7d124 lAllocID=46 dwSize=00000024, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7d17c lAllocID=47 dwSize=000000a8, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dd8fdc lAllocID=48 dwSize=0002b330, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e04344 lAllocID=49 dwSize=0000002c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e043a4 lAllocID=50 dwSize=00000028, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e04404 lAllocID=51 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e0485c lAllocID=52 dwSize=00000030, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e048c4 lAllocID=53 dwSize=00000030, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e0492c lAllocID=54 dwSize=00020020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d7d25c lAllocID=55 dwSize=00008020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d852b4 lAllocID=56 dwSize=00002020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e24984 lAllocID=57 dwSize=00000e20, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e257dc lAllocID=58 dwSize=00000120, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e25934 lAllocID=59 dwSize=00000060, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e259cc lAllocID=60 dwSize=000003ec, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e25dec lAllocID=61 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e25e74 lAllocID=62 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e25efc lAllocID=63 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8730c lAllocID=64 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e25f84 lAllocID=65 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87394 lAllocID=66 dwSize=00000054, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8741c lAllocID=67 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8749c lAllocID=70 dwSize=000000b8, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02da456c lAllocID=71 dwSize=00010020, ReturnAddr=65af9a1a (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8758c lAllocID=72 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8763c lAllocID=73 dwSize=000000c0, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87734 lAllocID=74 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d877e4 lAllocID=75 dwSize=000000c0, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d878dc lAllocID=76 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8798c lAllocID=77 dwSize=000000b0, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87a74 lAllocID=78 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87b24 lAllocID=79 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87bac lAllocID=80 dwSize=0000002c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87c0c lAllocID=81 dwSize=00000028, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87c6c lAllocID=82 dwSize=0000002c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87ccc lAllocID=83 dwSize=00000140, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87e44 lAllocID=84 dwSize=0000003c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02db45c4 lAllocID=85 dwSize=00004020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87eb4 lAllocID=86 dwSize=0000003c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02db861c lAllocID=87 dwSize=0000183c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d87f24 lAllocID=88 dwSize=0000021c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88174 lAllocID=89 dwSize=00000224, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d883cc lAllocID=90 dwSize=0000003c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8843c lAllocID=91 dwSize=00000060, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d884d4 lAllocID=92 dwSize=0000009c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d885a4 lAllocID=93 dwSize=00000050, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8862c lAllocID=94 dwSize=00000038, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8869c lAllocID=95 dwSize=00000080, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88754 lAllocID=96 dwSize=0000002c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d887b4 lAllocID=97 dwSize=00000040, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8882c lAllocID=98 dwSize=00000040, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d888a4 lAllocID=99 dwSize=00000040, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8891c lAllocID=100 dwSize=00000060, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d889b4 lAllocID=101 dwSize=00000030, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02db9e8c lAllocID=102 dwSize=00000b38, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e26004 lAllocID=103 dwSize=00020020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000f6fe4 lAllocID=104 dwSize=00008020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dba9fc lAllocID=105 dwSize=00002020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e4605c lAllocID=106 dwSize=00020020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 04800064 lAllocID=107 dwSize=00008020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e660b4 lAllocID=108 dwSize=00002020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88a1c lAllocID=109 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88e74 lAllocID=110 dwSize=0000002c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88ed4 lAllocID=111 dwSize=00000030, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 048080bc lAllocID=112 dwSize=0000517c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 0480d26c lAllocID=113 dwSize=00020020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88f3c lAllocID=114 dwSize=0000003c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6810c lAllocID=115 dwSize=00004020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d88fac lAllocID=116 dwSize=0000003c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 0482d2c4 lAllocID=117 dwSize=0000183c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 0482eb34 lAllocID=118 dwSize=0000fab8, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d8901c lAllocID=119 dwSize=00000068, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 0483e624 lAllocID=120 dwSize=0000101f, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbca54 lAllocID=121 dwSize=000000e4, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02d890bc lAllocID=122 dwSize=00000038, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbcb6c lAllocID=123 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbcbec lAllocID=124 dwSize=00000070, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbcc94 lAllocID=125 dwSize=00000028, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 0483f67c lAllocID=126 dwSize=000053c0, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbccf4 lAllocID=127 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbd14c lAllocID=128 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ff03c lAllocID=129 dwSize=000001a0, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02dbd5a4 lAllocID=131 dwSize=00000040, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ff214 lAllocID=132 dwSize=00000024, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ff26c lAllocID=133 dwSize=00000038, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ff2dc lAllocID=134 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ff734 lAllocID=135 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ffb8c lAllocID=136 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ffcd4 lAllocID=141 dwSize=00000010, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ffd1c lAllocID=142 dwSize=000000a8, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 04844a74 lAllocID=143 dwSize=0000c020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ffdfc lAllocID=144 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000ffeac lAllocID=145 dwSize=00000060, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 000fff44 lAllocID=146 dwSize=00000044, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 04850acc lAllocID=147 dwSize=00000024, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 04850b24 lAllocID=148 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 04850c6c lAllocID=149 dwSize=000000b8, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 04850d5c lAllocID=150 dwSize=00060020, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c164 lAllocID=151 dwSize=0000007c, ReturnAddr=65b0d617 (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c214 lAllocID=152 dwSize=0000005c, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c2a4 lAllocID=153 dwSize=00000044, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c31c lAllocID=154 dwSize=00000024, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c374 lAllocID=155 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c4bc lAllocID=156 dwSize=00000204, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6c6f4 lAllocID=157 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6cb4c lAllocID=158 dwSize=000001a4, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6cd24 lAllocID=159 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6cda4 lAllocID=160 dwSize=00000034, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6ce0c lAllocID=161 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6d264 lAllocID=162 dwSize=00000420, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6d6bc lAllocID=163 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6d804 lAllocID=164 dwSize=00000170, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6d9ac lAllocID=165 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6da2c lAllocID=166 dwSize=00000034, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6da94 lAllocID=167 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6dbdc lAllocID=168 dwSize=00000064, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6dc74 lAllocID=169 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6dcf4 lAllocID=170 dwSize=00000034, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6dd5c lAllocID=171 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6dea4 lAllocID=172 dwSize=00000064, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6df3c lAllocID=173 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6dfbc lAllocID=174 dwSize=00000034, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e024 lAllocID=175 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e16c lAllocID=176 dwSize=000000f0, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e294 lAllocID=177 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e314 lAllocID=178 dwSize=00000034, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e37c lAllocID=179 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e4c4 lAllocID=180 dwSize=000000ac, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e5a4 lAllocID=181 dwSize=00000048, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e624 lAllocID=182 dwSize=00000034, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e68c lAllocID=183 dwSize=00000112, ReturnAddr=65af99aa (pid=00000db0)
Direct3D9: (ERROR) :Memory Address: 02e6e7d4 lAllocID=184 dwSize=0000007c, ReturnAddr=65b15d24 (pid=00000db0)
Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 1820677 bytes
Direct3D9: :====> EXIT: DLLMAIN(65afa170): Process Detach 00000db0
D3DX: MEMORY LEAKS DETECTED: 2 allocations unfreed (448 bytes)
D3DX: Set HKLM\Software\Microsoft\Direct3D\D3DXBreakOnAllocId=0x1 to debug
The program '[3504] DirectXTutorial Project.exe: Native' has exited with code 0 (0x0).

Share this post


Link to post
Share on other sites
Did you happen to call ->Release() on the IDirect3D9* and IDirect3DDevice9* objects?


The fact that you have 2 unfreed allocations and created only two objects should be enough to tell you where it is.

If it's not (in a future scenario), you can put a breakpoint on the allocation ID (DirectX Control Panel)

Share this post


Link to post
Share on other sites
This is the only DirectX-related code that is run:



// Starting Point
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {

//Create game window object.
GAMEWINDOW* gw = new GAMEWINDOW(hInstance, 1280, 0, 1280, 1024, true, L"Game Test");

DisplayWindow(gw, nCmdShow);

if(FAILED(InitDirect3D(gw))) {
delete gw;
gw = NULL;
CloseDirect3D();
return 0;
}

//Destroy real-world physical game resource objects.
delete gw;

keyboard = NULL;

CloseDirect3D();

return 0;
}

// Create the Window Class and the Window
void DisplayWindow(GAMEWINDOW* gw, int nCmdShow) {
HWND hWnd = NULL;
WNDCLASSEX wc;

ZeroMemory(&wc, sizeof(WNDCLASSEX)); wc.cbSize = sizeof(WNDCLASSEX);
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.hInstance = *gw->GetHinstance();
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.lpszClassName = L"WindowClass";

RegisterClassEx(&wc);

hWnd = CreateWindowEx(NULL, wc.lpszClassName, gw->GetTitle(), gw->isWindowed() ? WS_OVERLAPPEDWINDOW : WS_EX_TOPMOST|WS_POPUP, gw->GetX(), gw->GetY(), gw->GetWidth(), gw->GetHeight(), NULL, NULL, *gw->GetHinstance(), NULL);

//Sets gamewindow object's local hWnd to function's.
gw->SetHwnd(hWnd);
ShowWindow(*gw->GetHwnd(), nCmdShow);
return;
}

//...


LPDIRECT3D9 d3d = NULL;
LPDIRECT3DDEVICE9 d3ddev = NULL;
D3DPRESENT_PARAMETERS d3dpp;
LPD3DXSPRITE sprite_handler = NULL;
FONT* font_handler = NULL;

// Create Direct3D and the Direct3D Device
HRESULT InitDirect3D(GAMEWINDOW* gw) {

if( NULL == (d3d = Direct3DCreate9(D3D_SDK_VERSION) ) )
return E_FAIL;

ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.SwapEffect = gw->isWindowed() ? D3DSWAPEFFECT_COPY : D3DSWAPEFFECT_FLIP;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.Windowed = gw->isWindowed();
d3dpp.BackBufferWidth = gw->GetWidth();
d3dpp.BackBufferHeight = gw->GetHeight();
d3dpp.BackBufferCount = 1;

d3d->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
*gw->GetHwnd(),
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&d3ddev);

D3DXCreateSprite(d3ddev, &sprite_handler);

return S_OK;
}

// Close the Device and Direct3D
void CloseDirect3D() {

if(font_handler) {
font_handler->Release();
delete font_handler;
font_handler = NULL;
}
if(d3ddev) {
d3ddev->Release();
d3ddev = NULL;
}
if(d3d) {
d3d->Release();
d3d = NULL;
}

return;
}



Share this post


Link to post
Share on other sites
..............

*headesk*

This is why I need a full-time editor instead of just little'ol'me working on this. :P

Thank goodness for development forums, eh?

EDIT:

On a related issue, how do you CHANGE a font /after/ it's been created with specific D3DXFONT::D3DXCreateFont() method?

I've traced most of my problems to that where I created a wrapper for the D3DXFONT and am continually using D3DXCreateFont to /change/ parameters instead of using another method.

[Edited by - cugone on August 14, 2009 1:33:30 PM]

Share this post


Link to post
Share on other sites
Why do you need to change your font so often?

Wouldn't you be better off having multiple font object and switching between them as needed?

Share this post


Link to post
Share on other sites
Quote:
Original post by adt7
Why do you need to change your font so often?

Wouldn't you be better off having multiple font object and switching between them as needed?


I was planning on a single font object, but considering for its Text3D sample the DX Docs does this:


//...
//--------------------------------------------------------------------------------------
// Global variables
//--------------------------------------------------------------------------------------
//...
ID3DXFont* g_pFont = NULL;
ID3DXFont* g_pFont2 = NULL;
ID3DXFont* g_pStatsFont = NULL;
ID3DXMesh* g_pMesh3DText = NULL;
//...




I think its okay to have several.

::EDIT::

Yay for curiosity. D3DXFont::getDesc fills a pointer of D3DXFONT_DESC which is exactly what I needed.



[Edited by - cugone on August 15, 2009 12:05:43 AM]

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