2009-04-23 Tom Hindle <tom_hindle@sil.org>
authorZoltan Varga <vargaz@gmail.com>
Tue, 28 Apr 2009 17:58:08 +0000 (17:58 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 28 Apr 2009 17:58:08 +0000 (17:58 -0000)
* cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.

svn path=/trunk/mono/; revision=132872

mono/metadata/ChangeLog
mono/metadata/cominterop.c

index a352da044bf4a1908883b9baf2d0b24fc3e91989..4da2250da934dfb09d9b1ce8980a124d995f68db 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-23 Tom Hindle <tom_hindle@sil.org>
+
+       * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
+       changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
+
 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
 
        * security-core-clr.c: Avoid redundant checks for platform code, 
index 1d9ee4a5b21071f11fe0a431528d439ad4bc9cc6..9d535779137b6277ecc480faf445d7165cbf3150 100644 (file)
@@ -1505,7 +1505,11 @@ ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal (MonoO
        proxy = (MonoComInteropProxy*)((MonoTransparentProxy*)object)->rp;
        g_assert (proxy);
 
+       if (proxy->ref_count == 0)
+               return -1;
+
        ref_count = InterlockedDecrement (&proxy->ref_count);
+
        g_assert (ref_count >= 0);
 
        if (ref_count == 0)