| Very slow dispose, though resources has been released |
|
 |
|
 |
|
 |
|
 |
Group: microsoft.public.win32.programmer.directx.graphics · Group Profile
Author: WilliamWilliam Date: Mar 4, 2008 03:46
I have problems with device.Dispose() taking very long when I have loaded a
lot of textures.
I have an example with arround 400 textures with text on them and mapped to
quads. All textures are in the managed pool and have been preloaded upon
creation. The quads are rendered using drawUserPrimitive and therefore have
no special resources such as vertexbuffers.
I am using events. Device.IsUsingEvents since I get another problem with
reset devices when I don't. If I turn events off then dispose is quite fast.
When looking into this it, seems that resources, the textures, are notified
through events when the device is disposed and this can take a while so one
should dispose the resources before disposing the device. I did that. I now
run through every last texture and call its Dispose. When I am done I call
device.Dispose() and it hangs just as long as before.
In the example with 400 textures it will hang for arround one minute, which
is certainly not accetable.
What would cause this delay and how do I deal with it?
|