oleaut32: Set the number of locks held on the safe arrays in the safe array tests to zero before destroying them, otherwise the operation will fail and leak memory.

This commit is contained in:
Rob Shearman 2007-12-07 14:14:33 +00:00 committed by Alexandre Julliard
parent 67a213fc1e
commit 2a9168e586
1 changed files with 3 additions and 0 deletions

View File

@ -208,6 +208,7 @@ static void test_marshal_LPSAFEARRAY(void)
LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2);
}
HeapFree(GetProcessHeap(), 0, buffer);
lpsa->cLocks = 0;
SafeArrayDestroy(lpsa);
/* test NULL safe array */
@ -244,6 +245,7 @@ static void test_marshal_LPSAFEARRAY(void)
check_safearray(buffer, lpsa);
HeapFree(GetProcessHeap(), 0, buffer);
lpsa->cLocks = 0;
SafeArrayDestroy(lpsa);
/* VARTYPE-less arrays can be marshaled if cbElements is 1,2,4 or 8 as type SF_In */
@ -1125,6 +1127,7 @@ static void test_marshal_VARIANT(void)
VARIANT_UserFree(&umcb.Flags, &v2);
}
HeapFree(GetProcessHeap(), 0, buffer);
lpsa->cLocks = 0;
SafeArrayDestroy(lpsa);
/*** VARIANT BYREF ***/