Re: DDraw: Split up the ddraw refcount
7 Jul
2006
7 Jul
'06
6:28 p.m.
Stefan Dösinger <stefandoesinger(a)gmx.at> writes:
+ if(ref == 0) InterlockedDecrement(&This->numIfaces);
- /* This is for the dll cleanup code in DllMain() */ - if(!This->DoNotDestroy) - IDirectDrawImpl_Destroy(This); - } + /* Checks the refcount before actually destroying the object */ + IDirectDrawImpl_Destroy(This);
This isn't thread safe, you should only call Destroy when the InterlockedDecrement returns 0, otherwise there's no point in using interlocked functions at all. Also you should get rid of the DoNotDestroy flag and use the refcount for that. -- Alexandre Julliard julliard(a)winehq.org
7104
Age (days ago)
7104
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard