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:
parent
fc9746013d
commit
41eeecbf9a
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue