edgar-mtz-e / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

DetectDoubleDispose and exceptions in constructors #431

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The DetectDoubleDispose feature of SlimDX prevents applications from
catching exceptions thrown from SlimDX constructors.

For example: Try to create a VolumeTexture that is too large for video
memory and catch Direct3D9Exception.

Observed behaviour:
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?)

Expected behaviour:
1. The constructor is aborted.
2. No ObjectDisposedException is thrown
3. My catch block is invoked.

The same problem also exists with other throwing constructors, e.g.
Direct3D9Ex() which throws Direct3D9Exception on Windows XP).

Original issue reported on code.google.com by rumz...@gmail.com on 12 Feb 2009 at 12:31

GoogleCodeExporter commented 9 years ago
Will fix.

Original comment by Mike.Popoloski on 17 Feb 2009 at 3:26

GoogleCodeExporter commented 9 years ago
Pri boost.

Original comment by promit....@gmail.com on 25 Feb 2009 at 9:17

GoogleCodeExporter commented 9 years ago
Taking ownership.

Original comment by Mike.Popoloski on 2 Mar 2009 at 3:42

GoogleCodeExporter commented 9 years ago
Fixed as of r930.

Original comment by Mike.Popoloski on 2 Mar 2009 at 4:10