dplayx: Remove AddRef hacks for the parent DirectPlay object.

oldstable
Michael Stefaniuc 2013-03-29 16:47:39 +01:00 committed by Alexandre Julliard
parent b78f7290fe
commit 6f370dff7f
3 changed files with 2 additions and 41 deletions

View File

@ -173,21 +173,6 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
This->sp->dplay = dp;
/* Normally we should be keeping a reference, but since only the dplay
* interface that created us can destroy us, we do not keep a reference
* to it (ie we'd be stuck with always having one reference to the dplay
* object, and hence us, around).
* NOTE: The dp object does reference count us.
*
* FIXME: This is a kludge to get around a problem where a queryinterface
* is used to get a new interface and then is closed. We will then
* reference garbage. However, with this we will never deallocate
* the interface we store. The correct fix is to require all
* DP internal interfaces to use the This->dp2 interface which
* should be changed to This->dp
*/
IDirectPlayX_AddRef( (LPDIRECTPLAY2)dp );
return TRUE;
}
@ -195,14 +180,6 @@ static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP )
{
IDirectPlaySPImpl *This = lpSP;
/* Normally we should be keeping a reference, but since only the dplay
* interface that created us can destroy us, we do not keep a reference
* to it (ie we'd be stuck with always having one reference to the dplay
* object, and hence us, around).
* NOTE: The dp object does reference count us.
*/
/*IDirectPlayX_Release( (LPDIRECTPLAY2)This->sp->dplay ); */
HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData );
HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData );

View File

@ -148,22 +148,6 @@ static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
This->sp->dplay = dp;
/* Normally we should be keeping a reference, but since only the dplay
* interface that created us can destroy us, we do not keep a reference
* to it (ie we'd be stuck with always having one reference to the dplay
* object, and hence us, around).
* NOTE: The dp object does reference count us.
*
* FIXME: This is a kludge to get around a problem where a queryinterface
* is used to get a new interface and then is closed. We will then
* reference garbage. However, with this we will never deallocate
* the interface we store. The correct fix is to require all
* DP internal interfaces to use the This->dp2 interface which
* should be changed to This->dp
*/
IDirectPlayX_AddRef( (LPDIRECTPLAY2)dp );
return TRUE;
}

View File

@ -6394,7 +6394,7 @@ static void test_COM(void)
(void**)&dp4);
ok(hr == S_OK, "DirectPlay create failed: %08x, expected S_OK\n", hr);
refcount = IDirectPlayX_AddRef(dp4);
todo_wine ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
hr = IDirectPlayX_QueryInterface(dp4, &IID_IDirectPlay2A, (void**)&dp2A);
ok(hr == S_OK, "QueryInterface for IID_IDirectPlay2A failed: %08x\n", hr);
@ -6441,7 +6441,7 @@ static void test_COM(void)
IDirectPlay2_Release(dp2A);
IDirectPlayX_Release(dp4);
refcount = IDirectPlayX_Release(dp4);
todo_wine ok(refcount == 0, "refcount == %u, expected 0\n", refcount);
ok(refcount == 0, "refcount == %u, expected 0\n", refcount);
}