summaryrefslogtreecommitdiff
path: root/tests/src/GC/API/GCHandle/Casting.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/GC/API/GCHandle/Casting.cs')
-rw-r--r--tests/src/GC/API/GCHandle/Casting.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/src/GC/API/GCHandle/Casting.cs b/tests/src/GC/API/GCHandle/Casting.cs
index 94f8c40e13..b755804c05 100644
--- a/tests/src/GC/API/GCHandle/Casting.cs
+++ b/tests/src/GC/API/GCHandle/Casting.cs
@@ -33,7 +33,12 @@ public class CastingTest
GCHandle gch = GCHandle.Alloc(new Dummy(dummyValue));
GCHandle gch2 = (GCHandle)((IntPtr)gch);
- if (gch.Target == gch2.Target)
+
+ bool success = (gch.Target == gch2.Target);
+
+ gch.Free();
+
+ if (success)
{
Console.WriteLine("CastTest Passed");
return true;