Sign in to follow this  
samv

[SlimDX] DetectDoubleDispose and exceptions in constructors

Recommended Posts

I'm trying to create a large VolumeTexture and the constructor of this class throws an exception, reporting that there is not enough video memory. Now I would like to catch that exception. However, this doesn't seem to work when the DetectDoubleDispose feature of SlimDX is used. As far as I can tell this is because: 1. The constructor of VolumeTexture is aborted before calling Construct 2. The resources base destructor of ComObject is called 3. A false positive "double dispose" is detected because of 1. 4. An ObjectDisposedException is thrown 5. My catch block is not invoked (because the original exception is dropped?) Does this sound correct? Is this a known problem?

Share this post


Link to post
Share on other sites
Any progress?

I again see this same problem when trying to create D3DEx. The constructor is supposed to fail on XP and throw Direct3D9Exception, but that is hidden by a false positive ObjectDisposedException when using the DetectDoubleDispose feature.

BTW should I post such issues here or on the SlimDX google code site or both or ...?

Share this post


Link to post
Share on other sites
It looks like Promit forgot about this again [grin]

Filing the issue on our tracker was definitely the right way to go, and we should have advised you to do that earlier. When bugs aren't filed, we tend to forget about them. It's too difficult to keep track of forum threads for very long.

Anyways, you can listen to that issue and subscribe to be notified of any updates we make to it.

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