cairo: fix leak when Context object is finalized

When the finalizer calls Dispose(), disposing is false, it means that
CairoDebug traces should be printed, but the reference count on the
native context should still be decreased. Otherwise a real leak
would appear, as the native context would never be freed when the
managed object is GCed.
This commit is contained in:
Andrés G. Aragoneses 2013-11-03 14:01:01 +01:00 committed by Bertrand Lorentz
parent fc9746013d
commit 41eeecbf9a

View File

@ -115,7 +115,7 @@ namespace Cairo {
if (!disposing || CairoDebug.Enabled)
CairoDebug.OnDisposed<Context> (handle, disposing);
if (!disposing || handle == IntPtr.Zero)
if (handle == IntPtr.Zero)
return;
NativeMethods.cairo_destroy (handle);