Author: tkreuzer
Date: Sat Mar 3 20:00:51 2012
New Revision: 55970
URL:
http://svn.reactos.org/svn/reactos?rev=55970&view=rev
Log:
[WIN32K]
- Fix a memory leak in EngUnloadImage
- add an ASSERT
Modified:
trunk/reactos/subsystems/win32/win32k/eng/ldevobj.c
trunk/reactos/subsystems/win32/win32k/eng/pdevobj.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/ldevobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/ldevobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/ldevobj.c [iso-8859-1] Sat Mar 3 20:00:51
2012
@@ -98,6 +98,7 @@
{
/* Make sure we don't have a driver loaded */
ASSERT(pldev && pldev->pGdiDriverInfo == NULL);
+ ASSERT(pldev->cRefs == 0);
/* Free the memory */
ExFreePoolWithTag(pldev, GDITAG_LDEV);
@@ -472,8 +473,9 @@
if (pldev->pldevNext)
pldev->pldevNext->pldevPrev = pldev->pldevPrev;
- /* Unload the image */
+ /* Unload the image and free the LDEV */
LDEVOBJ_vUnloadImage(pldev);
+ LDEVOBJ_vFreeLDEV(pldev);
}
/* Unlock loader */
Modified: trunk/reactos/subsystems/win32/win32k/eng/pdevobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/pdevobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/pdevobj.c [iso-8859-1] Sat Mar 3 20:00:51
2012
@@ -190,7 +190,7 @@
{
PGRAPHICS_DEVICE pGraphicsDevice;
PDEVMODEW pdmCurrent;
- INT i;
+ ULONG i;
DWORD dwFields;
pGraphicsDevice = ppdev->pGraphicsDevice;