Commit 2a9168e5 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

oleaut32: Set the number of locks held on the safe arrays in the safe array…

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.
parent 67a213fc
...@@ -208,6 +208,7 @@ static void test_marshal_LPSAFEARRAY(void) ...@@ -208,6 +208,7 @@ static void test_marshal_LPSAFEARRAY(void)
LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2); LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2);
} }
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
lpsa->cLocks = 0;
SafeArrayDestroy(lpsa); SafeArrayDestroy(lpsa);
/* test NULL safe array */ /* test NULL safe array */
...@@ -244,6 +245,7 @@ static void test_marshal_LPSAFEARRAY(void) ...@@ -244,6 +245,7 @@ static void test_marshal_LPSAFEARRAY(void)
check_safearray(buffer, lpsa); check_safearray(buffer, lpsa);
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
lpsa->cLocks = 0;
SafeArrayDestroy(lpsa); SafeArrayDestroy(lpsa);
/* VARTYPE-less arrays can be marshaled if cbElements is 1,2,4 or 8 as type SF_In */ /* 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) ...@@ -1125,6 +1127,7 @@ static void test_marshal_VARIANT(void)
VARIANT_UserFree(&umcb.Flags, &v2); VARIANT_UserFree(&umcb.Flags, &v2);
} }
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
lpsa->cLocks = 0;
SafeArrayDestroy(lpsa); SafeArrayDestroy(lpsa);
/*** VARIANT BYREF ***/ /*** VARIANT BYREF ***/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment