- Plug some object leaks in callproc and clipboard code

svn path=/trunk/; revision=57642
This commit is contained in:
Giannis Adamopoulos 2012-10-28 17:31:33 +00:00
parent b6e5342bce
commit 7aed406e55
2 changed files with 12 additions and 0 deletions

View file

@ -46,6 +46,9 @@ CreateCallProc(IN PDESKTOP Desktop,
NewCallProc->spcpdNext = NULL; NewCallProc->spcpdNext = NULL;
} }
/* Release the extra reference (UserCreateObject added 2 references) */
UserDereferenceObject(NewCallProc);
return NewCallProc; return NewCallProc;
} }

View file

@ -211,6 +211,9 @@ IntSynthesizeDib(
/* Add the clipboard data */ /* Add the clipboard data */
IntAddFormatedData(pWinStaObj, CF_DIB, hMem, TRUE, TRUE); IntAddFormatedData(pWinStaObj, CF_DIB, hMem, TRUE, TRUE);
/* Release the extra reference (UserCreateObject added 2 references) */
UserDereferenceObject(pClipboardData);
cleanup: cleanup:
UserReleaseDC(NULL, hdc, FALSE); UserReleaseDC(NULL, hdc, FALSE);
} }
@ -302,6 +305,9 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
*((LCID*)pMemObj->Data) = NtCurrentTeb()->CurrentLocale; *((LCID*)pMemObj->Data) = NtCurrentTeb()->CurrentLocale;
IntAddFormatedData(pWinStaObj, CF_LOCALE, hMem, TRUE, TRUE); IntAddFormatedData(pWinStaObj, CF_LOCALE, hMem, TRUE, TRUE);
} }
/* Release the extra reference (UserCreateObject added 2 references) */
UserDereferenceObject(pMemObj);
} }
/* Add CF_TEXT. Note: it is synthesized in user32.dll */ /* Add CF_TEXT. Note: it is synthesized in user32.dll */
@ -1099,6 +1105,9 @@ NtUserConvertMemHandle(
} }
_SEH2_END; _SEH2_END;
/* Release the extra reference (UserCreateObject added 2 references) */
UserDereferenceObject(pMemObj);
/* If we failed to copy data, remove handle */ /* If we failed to copy data, remove handle */
if (!pMemObj) if (!pMemObj)
{ {