From 41eeecbf9a6d84fa29ccee9adfee98ada1f1de66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Sun, 3 Nov 2013 14:01:01 +0100 Subject: [PATCH] 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. --- cairo/Context.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cairo/Context.cs b/cairo/Context.cs index b420f775d..73df43807 100644 --- a/cairo/Context.cs +++ b/cairo/Context.cs @@ -115,7 +115,7 @@ namespace Cairo { if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing || handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_destroy (handle);