Jump to content
  • Advertisement
Sign in to follow this  
TomCatFort

Can't release some resource before calling Reset

This topic is 3636 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a simple 2D engine with Direct3D 9. It works very well in windowed mode, so I decided to upgrade it to full screen mode. I managed to handle the lost device event with a long work I went to eat and take a nap. 2 hours later I sit back to my computer and unfortunately something happened I my program can't reset the device. DirectX said that 3 object wasn't released before I call the Reset function. I used the debug features to identify these objects: 2 is created by a DirectX Font object (vertex and an index buffer) DrawText function. The third is a surface created by the Direct3D Interface :: CreateDevice function. I tried to solve the problem but I failed and in fact I don't know what happening and why. Can someone please help me? This the debug output: Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_SIZE hWnd=610828 wp=0000, lp=02580320 dwFlags=00000001 Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=00000204, tid=00000ea0 Direct3D9: :*** Active state changing Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=00000204, tid=00000ea0 Direct3D9: (ERROR) :All user created stateblocks must be freed before Reset can succeed. Reset Fails. Direct3D9: (ERROR) :Reset failed and Reset/TestCooperativeLevel/Release are the only legal APIs to be called subsequently Direct3D9: :DoneExclusiveMode Direct3D9: :Unsubclassing window 00610828 'Test one.exe': Loaded 'C:\WINDOWS\system32\winsta.dll' 'Test one.exe': Loaded 'C:\WINDOWS\system32\netapi32.dll' Direct3D9: (ERROR) :The following D3DPOOL_DEFAULT surfaces/buffers/textures still exist Direct3D9: (ERROR) : D3DRTYPE_VERTEXBUFFER Direct3D9: (ERROR) : Memory Address: 00d2a1b8 lAllocID=212 dwSize=00000050, (pid=00000204) Direct3D9: (ERROR) : Stack Back Trace # Direct3D9: (ERROR) : : Address 010B7CE6 Direct3D9: (ERROR) : [1] : Address 0118BBC3 Direct3D9: (ERROR) : [2] : Address 01106EAF Direct3D9: (ERROR) : [3] : Address 010FB054 Direct3D9: (ERROR) : [4] : Address 010FCCD5 Direct3D9: (ERROR) : [5] : Address 010FAC76 Direct3D9: (ERROR) : [6] : Address 010FAACD Direct3D9: (ERROR) : [7] : Address 010E5692 Direct3D9: (ERROR) : [8] : Address 004E4EE3 Direct3D9: (ERROR) : [9] : Address 004E9CC3 Direct3D9: (ERROR) : [10] : Address 004EA378 Direct3D9: (ERROR) : [11] : Address 004181C6 Direct3D9: (ERROR) : [12] : Address 004126C8 Direct3D9: (ERROR) : [13] : Address 00420048 Direct3D9: (ERROR) : [14] : Address 0041FDAF Direct3D9: (ERROR) : [15] : Address 7C816D4F Direct3D9: (ERROR) : D3DRTYPE_INDEXBUFFER Direct3D9: (ERROR) : Memory Address: 00d2a378 lAllocID=209 dwSize=00000050, (pid=00000204) Direct3D9: (ERROR) : Stack Back Trace Direct3D9: (ERROR) : # : Address 010B7CE6 Direct3D9: (ERROR) : [1] : Address 0118BBC3 Direct3D9: (ERROR) : [2] : Address 01106EAF Direct3D9: (ERROR) : [3] : Address 010F6D54 Direct3D9: (ERROR) : [4] : Address 010F8945 Direct3D9: (ERROR) : [5] : Address 010F6976 Direct3D9: (ERROR) : [6] : Address 010F680F Direct3D9: (ERROR) : [7] : Address 010E5932 Direct3D9: (ERROR) : [8] : Address 004E4E4E Direct3D9: (ERROR) : [9] : Address 004E9CC3 Direct3D9: (ERROR) : [10] : Address 004EA378 Direct3D9: (ERROR) : [11] : Address 004181C6 Direct3D9: (ERROR) : [12] : Address 004126C8 Direct3D9: (ERROR) : [13] : Address 00420048 Direct3D9: (ERROR) : [14] : Address 0041FDAF Direct3D9: (ERROR) : [15] : Address 7C816D4F Direct3D9: (ERROR) : D3DRTYPE_SURFACE Direct3D9: (ERROR) : Memory Address: 00d22178 lAllocID=52 dwSize=00000050, (pid=00000204) Direct3D9: (ERROR) : Stack Back Trace Direct3D9: (ERROR) : # : Address 010B7CE6 Direct3D9: (ERROR) : [1] : Address 0118BBC3 Direct3D9: (ERROR) : [2] : Address 010D5599 Direct3D9: (ERROR) : [3] : Address 010D8491 Direct3D9: (ERROR) : [4] : Address 010D4947 Direct3D9: (ERROR) : [5] : Address 010E65BC Direct3D9: (ERROR) : [6] : Address 01186A53 Direct3D9: (ERROR) : [7] : Address 004131D5 Direct3D9: (ERROR) : [8] : Address 0041200E Direct3D9: (ERROR) : [9] : Address 00420048 Direct3D9: (ERROR) : [10] : Address 0041FDAF Direct3D9: (ERROR) : [11] : Address 7C816D4F Direct3D9: (ERROR) : [12] : Address 00000000 Direct3D9: (ERROR) : [13] : Address 00000000 Direct3D9: (ERROR) : [14] : Address 00000000 Direct3D9: (ERROR) : [15] : Address 00000000

Share this post


Link to post
Share on other sites
Advertisement
first of all, see This and This regarding D3DXFont usage.

For some reason I cannot recall the solution to the surface question, but for some reason it is alluding me at the moment. Tip of my tongue, etc.

By the way, the DirectX forum would be a place to get much faster answers to such a specific D3D question than For Beginners.

[Edited by - Drigovas on July 6, 2008 7:36:48 PM]

Share this post


Link to post
Share on other sites
YEEEY!!! It's working! Don't know what caoused the error but some important thing: don't let even a single unnecessary thing to be called between the resource release and the Reset.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!