mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-10 22:25:40 +00:00
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
|
@ -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