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:
Andrés G. Aragoneses 2013-11-05 00:14:33 +01:00 committed by Bertrand Lorentz
parent 694357cc5b
commit 8aaed84e5e
7 changed files with 7 additions and 7 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);