mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-07 07:23:18 +02: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)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<FontFace> (handle, disposing);
|
CairoDebug.OnDisposed<FontFace> (handle, disposing);
|
||||||
|
|
||||||
if (!disposing|| handle == IntPtr.Zero)
|
if (handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_font_face_destroy (handle);
|
NativeMethods.cairo_font_face_destroy (handle);
|
||||||
|
@ -76,7 +76,7 @@ namespace Cairo
|
|||||||
if (!disposing || CairoDebug.Enabled)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<FontOptions> (handle, disposing);
|
CairoDebug.OnDisposed<FontOptions> (handle, disposing);
|
||||||
|
|
||||||
if (!disposing|| handle == IntPtr.Zero)
|
if (handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_font_options_destroy (handle);
|
NativeMethods.cairo_font_options_destroy (handle);
|
||||||
|
@ -66,7 +66,7 @@ namespace Cairo {
|
|||||||
if (!disposing || CairoDebug.Enabled)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<Path> (handle, disposing);
|
CairoDebug.OnDisposed<Path> (handle, disposing);
|
||||||
|
|
||||||
if (!disposing || handle == IntPtr.Zero)
|
if (handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_path_destroy (handle);
|
NativeMethods.cairo_path_destroy (handle);
|
||||||
|
@ -103,7 +103,7 @@ namespace Cairo {
|
|||||||
if (!disposing || CairoDebug.Enabled)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<Pattern> (Handle, disposing);
|
CairoDebug.OnDisposed<Pattern> (Handle, disposing);
|
||||||
|
|
||||||
if (!disposing|| Handle == IntPtr.Zero)
|
if (Handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_pattern_destroy (Handle);
|
NativeMethods.cairo_pattern_destroy (Handle);
|
||||||
|
@ -98,7 +98,7 @@ namespace Cairo
|
|||||||
if (!disposing || CairoDebug.Enabled)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<Region> (handle, disposing);
|
CairoDebug.OnDisposed<Region> (handle, disposing);
|
||||||
|
|
||||||
if (!disposing|| handle == IntPtr.Zero)
|
if (handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_region_destroy (Handle);
|
NativeMethods.cairo_region_destroy (Handle);
|
||||||
|
@ -116,7 +116,7 @@ namespace Cairo {
|
|||||||
if (!disposing || CairoDebug.Enabled)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<ScaledFont> (handle, disposing);
|
CairoDebug.OnDisposed<ScaledFont> (handle, disposing);
|
||||||
|
|
||||||
if (!disposing|| handle == IntPtr.Zero)
|
if (handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_scaled_font_destroy (handle);
|
NativeMethods.cairo_scaled_font_destroy (handle);
|
||||||
|
@ -147,7 +147,7 @@ namespace Cairo {
|
|||||||
if (!disposing || CairoDebug.Enabled)
|
if (!disposing || CairoDebug.Enabled)
|
||||||
CairoDebug.OnDisposed<Surface> (handle, disposing);
|
CairoDebug.OnDisposed<Surface> (handle, disposing);
|
||||||
|
|
||||||
if (!disposing || handle == IntPtr.Zero)
|
if (handle == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NativeMethods.cairo_surface_destroy (handle);
|
NativeMethods.cairo_surface_destroy (handle);
|
||||||
|
Loading…
Reference in New Issue
Block a user