[SlimDX] DetectDoubleDispose and exceptions in constructors

Started by
5 comments, last by Promit 15 years, 1 month ago
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?
___________________________Buggrit, millennium hand and shrimp!
Advertisement
Could be a problem. I'll take a look at how that mechanism works again and see.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Did you find some time to look into this?
___________________________Buggrit, millennium hand and shrimp!
Not yet, I'll try and hit it over the weekend.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
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 ...?
___________________________Buggrit, millennium hand and shrimp!
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.
Mike Popoloski | Journal | SlimDX
I forgot to mention this, but I basically know why this occurs, I just haven't decided how exactly to fix it yet.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement