Author: greatlrd
Date: Wed Apr 5 14:16:11 2006
New Revision: 21461
URL:
http://svn.reactos.ru/svn/reactos?rev=21461&view=rev
Log:
fix a memmory leak in create surface
Modified:
trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Wed Apr 5 14:16:11 2006
@@ -66,7 +66,7 @@
mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface;
mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary;//pDDSD;
mDdCreateSurface.lplpSList = This->mpPrimaryLocals; //cSurfaces;
- mDdCreateSurface.dwSCnt = 1 ; //ppSurfaces;
+ mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ;
//ppSurfaces;
if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) ==
DDHAL_DRIVER_NOTHANDLED)
{
@@ -138,8 +138,7 @@
if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)==
DDHAL_DRIVER_NOTHANDLED)
{
- // derr(L"DirectDrawImpl[%08x]::__createPrimary Cannot create primary
[%08x]", this, rv);
- return DDERR_NOTINITIALIZED;
+ return DDERR_NOTINITIALIZED;
}
if (mDdCanCreateSurface.ddRVal != DD_OK)
@@ -181,7 +180,7 @@
This->mpOverlayLocals[i] = &This->mOverlayLocal[i];
}
- for (i = 0; i < cSurfaces; i++)
+ for ( i = 0; i < cSurfaces; i++)
{
UINT j = (i + 1) % cSurfaces;
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Wed Apr 5 14:16:11 2006
@@ -275,6 +275,7 @@
ret = Hel_DirectDraw_CreateSurface (iface, pDDSD, ppSurf, pUnkOuter);
}
+ This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)&This->mPrimaryLocal;
// the real surface object creation