Sign in to follow this  

[.net] Memory leak with TextureLoader.FromFile

Recommended Posts

Hi All, I'm having a problem with TextureLoader.FromFile - whenever my app exits it reports that I have a memory leak.
texture = TextureLoader.FromFile(CD3DEngine.device, @"..\..\wood.jpg", 256, 256, D3DX.Default, 0, Format.Unknown,
 Pool.Managed, Filter.Point, Filter.Point, 0);
This is how I am calling FromFile - now, technically I don't have to use this overloaded method, but I am really interested as to why there is a memory leak.. any ideas?

Share this post

Link to post
Share on other sites
Ah - no, I was coding using the unmanaged directx earlier in the day. For some reason, if you have both the managed, and unmanaged debug versions of the SDK enabled you get the errors...

By the way, the error (warning) is:

The thread 'Win32 Thread' (0x97c) has exited with code 0 (0x0).
Direct3D9: :====> ENTER: DLLMAIN(07cb36a0): Process Detach 00000f3c, tid=00000f40
Direct3D9: (INFO) :MemFini!
Direct3D9: (ERROR) :Memory still allocated! Alloc count = 164
Direct3D9: (ERROR) :Current Process (pid) = 00000f3c
Direct3D9: (ERROR) :Memory Address: 003447ac lAllocID=1 dwSize=000047f8, ReturnAddr=07cb34c8 (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 0034b214 lAllocID=9 dwSize=000014ac, ReturnAddr=07cac2cb (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 0034c6f4 lAllocID=10 dwSize=00000004, ReturnAddr=07cac36b (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 0034c72c lAllocID=11 dwSize=00000bd0, ReturnAddr=07cb1741 (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 0034d5cc lAllocID=20 dwSize=000006bc, ReturnAddr=07cbf3b3 (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 00348fdc lAllocID=22 dwSize=00001878, ReturnAddr=07cb45bd (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 00342974 lAllocID=24 dwSize=00000004, ReturnAddr=07cb46ee (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 07ec0064 lAllocID=26 dwSize=00003508, ReturnAddr=07cb34c8 (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 0034dcbc lAllocID=27 dwSize=00000198, ReturnAddr=07cb34c8 (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 0034de8c lAllocID=28 dwSize=00000030, ReturnAddr=07cb34c8 (pid=00000f3c)
Direct3D9: (ERROR) :Memory Address: 07ec35a4 lAllocID=29 dwSize=00001020, ReturnAddr=07cb34c8 (pid=00000f3c)
Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 52896 bytes

Pretty much the same kind of error that you get when you don't call release on an unmanaged device or object.

Share this post

Link to post
Share on other sites
I've had similar problems with Managed DX also, and I double-checked that the code disposes all unmanaged objects in reverse creation order. Furthermore, the problem was only evident when using D3DX loaders, just like you describe.

I've informed MS about this.

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