System.Drawing.ComIStreamMarshaler.ManagedToNativeWrapper.Release C# (CSharp) Method

Release() private static method

private static Release ( IntPtr @this ) : int
@this System.IntPtr
return int
			private static int Release(IntPtr @this)
			{
#if MAP_EX_TO_HR
				try
				{
#endif
					ManagedToNativeWrapper thisObject = GetObject(@this);

					lock (thisObject)
					{
						if ((thisObject.refCount != 0) && (--thisObject.refCount == 0))
							thisObject.Dispose();

						return thisObject.refCount;
					}
#if MAP_EX_TO_HR
				}
				catch
				{
					return 0;
				}
#endif
			}