mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 10:45:30 +00:00
cairo: Fix remaining leaks when finalizer gets called
Apply same finalizer leak fix to the rest of IDisposable-ownership cairo classes as the one recently committed for Cairo.Context[1]. [1] https://github.com/mono/gtk-sharp/commit/41eeecbf9a6d8
This commit is contained in:
parent
694357cc5b
commit
8aaed84e5e
|
@ -61,7 +61,7 @@ namespace Cairo
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<FontFace> (handle, disposing);
|
||||
|
||||
if (!disposing|| handle == IntPtr.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_font_face_destroy (handle);
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Cairo
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<FontOptions> (handle, disposing);
|
||||
|
||||
if (!disposing|| handle == IntPtr.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_font_options_destroy (handle);
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace Cairo {
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<Path> (handle, disposing);
|
||||
|
||||
if (!disposing || handle == IntPtr.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_path_destroy (handle);
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace Cairo {
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<Pattern> (Handle, disposing);
|
||||
|
||||
if (!disposing|| Handle == IntPtr.Zero)
|
||||
if (Handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_pattern_destroy (Handle);
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace Cairo
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<Region> (handle, disposing);
|
||||
|
||||
if (!disposing|| handle == IntPtr.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_region_destroy (Handle);
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace Cairo {
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<ScaledFont> (handle, disposing);
|
||||
|
||||
if (!disposing|| handle == IntPtr.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_scaled_font_destroy (handle);
|
||||
|
|
|
@ -147,7 +147,7 @@ namespace Cairo {
|
|||
if (!disposing || CairoDebug.Enabled)
|
||||
CairoDebug.OnDisposed<Surface> (handle, disposing);
|
||||
|
||||
if (!disposing || handle == IntPtr.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
NativeMethods.cairo_surface_destroy (handle);
|
||||
|
|
Loading…
Reference in a new issue