mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 09:43:04 +00:00
start implement release for dd interface, we do not release everthing yet, we still have some memory leak.
svn path=/trunk/; revision=25155
This commit is contained in:
parent
849df320ad
commit
45000c2da2
2 changed files with 38 additions and 4 deletions
|
@ -15,9 +15,41 @@
|
||||||
VOID
|
VOID
|
||||||
Cleanup(LPDIRECTDRAW7 iface)
|
Cleanup(LPDIRECTDRAW7 iface)
|
||||||
{
|
{
|
||||||
|
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||||
|
|
||||||
|
if (ddgbl.lpDDCBtmp != NULL)
|
||||||
|
{
|
||||||
|
DxHeapMemFree(ddgbl.lpDDCBtmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ddgbl.lpModeInfo != NULL)
|
||||||
|
{
|
||||||
|
DxHeapMemFree(ddgbl.lpModeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME
|
/* FIXME
|
||||||
free all memory and delete all dx stuff
|
delete the DC we create
|
||||||
|
delete the dx handler we got from hal
|
||||||
|
any more I forget ?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* release the linked interface */
|
||||||
|
while (This->lpVtbl != NULL)
|
||||||
|
{
|
||||||
|
LPDDRAWI_DIRECTDRAW_INT newThis = This->lpVtbl;
|
||||||
|
if (This->lpLcl != NULL)
|
||||||
|
{
|
||||||
|
DxHeapMemFree(This->lpLcl);
|
||||||
|
}
|
||||||
|
|
||||||
|
This = newThis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* release unlinked interface */
|
||||||
|
if (This->lpLcl != NULL)
|
||||||
|
{
|
||||||
|
DxHeapMemFree(This->lpLcl);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,9 @@ VOID Cleanup(LPDIRECTDRAW7 iface);
|
||||||
|
|
||||||
/* own macro to alloc memmory */
|
/* own macro to alloc memmory */
|
||||||
#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m)
|
#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m)
|
||||||
#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p);
|
#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p); \
|
||||||
|
p = NULL;
|
||||||
|
|
||||||
/******** Main Object ********/
|
/******** Main Object ********/
|
||||||
|
|
||||||
/* Public interface */
|
/* Public interface */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue