Re: d3d9 : do not proceed reset or release from another thread than the one which created the device.
2008/11/30 Jérôme Gardou <jerome.gardou(a)gmail.com>:
- if (ref == 0) { + if (ref <= 0) { This doesn't work, of course. ref is an ULONG. The check for Reset should probably go into wined3d.
Henri Verbeet a écrit :
2008/11/30 Jérôme Gardou <jerome.gardou(a)gmail.com>:
- if (ref == 0) { + if (ref <= 0) {
This doesn't work, of course. ref is an ULONG. Why not just a cast in this case ? The check for Reset should probably go into wined3d.
OK... but a test should check is this is the same behaviour in d3d8. Not sure...
Jérôme Gardou a écrit :
Henri Verbeet a écrit :
2008/11/30 Jérôme Gardou <jerome.gardou(a)gmail.com>:
- if (ref == 0) { + if (ref <= 0) {
This doesn't work, of course. ref is an ULONG.
Why not just a cast in this case ?
According to d3d9_private.h , ref is a LONG.
Henri Verbeet a écrit :
2008/12/6 Jérôme Gardou <jerome.gardou(a)gmail.com>:
According to d3d9_private.h , ref is a LONG.
ref is not defined in d3d9_private.h.
Taken from d3d9_private.h : typedef struct IDirect3DDevice9Impl { /* IUnknown fields */ const IDirect3DDevice9ExVtbl *lpVtbl; LONG ref; ... That's why the compiler did not complained... But release actually returns a ULONG, and the IUnknown ref is an ULONG anyway... I guess this should be changed for consistency.
Jérôme Gardou a écrit :
Henri Verbeet a écrit :
2008/12/6 Jérôme Gardou <jerome.gardou(a)gmail.com>:
According to d3d9_private.h , ref is a LONG.
ref is not defined in d3d9_private.h.
Taken from d3d9_private.h :
typedef struct IDirect3DDevice9Impl { /* IUnknown fields */ const IDirect3DDevice9ExVtbl *lpVtbl; LONG ref; ...
That's why the compiler did not complained... But release actually returns a ULONG, and the IUnknown ref is an ULONG anyway... I guess this should be changed for consistency.
Oh dear... I upgraded my winXP VM to SP3 yesterday, and the tests I wrote now crash... seems like d3d9 does not care about threads anymore...
participants (2)
-
Henri Verbeet -
Jérôme Gardou