* ComInteropProxy.cs: Don't add proxy if it has already been added.
Instread increment ref_count. Fixes bug #572043.
svn path=/trunk/mcs/; revision=152571
+2010-01-19 Tom Hindle <tom_hindle@sil.org>
+
+ * ComInteropProxy.cs: Don't add proxy if it has already been added.
+ Instread increment ref_count. Fixes bug #572043.
+
2009-07-11 Robert Jordan <robertj@gmx.net>
* ComInteropProxy.cs: Implement CreateProxy. Hide public/internal
{
// called from unmanaged code after .ctor is invoked
// we need .ctor to create unmanaged object and thus IUnknown property value
- AddProxy (com_object.IUnknown, this);
+ if (FindProxy(com_object.IUnknown) == null)
+ AddProxy (com_object.IUnknown, this);
+ else
+ System.Threading.Interlocked.Increment (ref ref_count);
}
ComInteropProxy (IntPtr pUnk)