From 8aaed84e5ee0f64f11299398f9a42abcbe8fd109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 5 Nov 2013 00:14:33 +0100 Subject: [PATCH] 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 --- cairo/FontFace.cs | 2 +- cairo/FontOptions.cs | 2 +- cairo/Path.cs | 2 +- cairo/Pattern.cs | 2 +- cairo/Region.cs | 2 +- cairo/ScaledFont.cs | 2 +- cairo/Surface.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cairo/FontFace.cs b/cairo/FontFace.cs index b8ce89866..b2c141bd4 100644 --- a/cairo/FontFace.cs +++ b/cairo/FontFace.cs @@ -61,7 +61,7 @@ namespace Cairo if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing|| handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_font_face_destroy (handle); diff --git a/cairo/FontOptions.cs b/cairo/FontOptions.cs index 3c151c59d..e1fe2e5c1 100644 --- a/cairo/FontOptions.cs +++ b/cairo/FontOptions.cs @@ -76,7 +76,7 @@ namespace Cairo if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing|| handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_font_options_destroy (handle); diff --git a/cairo/Path.cs b/cairo/Path.cs index 6e177fc20..22cbb138d 100644 --- a/cairo/Path.cs +++ b/cairo/Path.cs @@ -66,7 +66,7 @@ namespace Cairo { if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing || handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_path_destroy (handle); diff --git a/cairo/Pattern.cs b/cairo/Pattern.cs index fa130ce65..31ae26f4c 100644 --- a/cairo/Pattern.cs +++ b/cairo/Pattern.cs @@ -103,7 +103,7 @@ namespace Cairo { if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (Handle, disposing); - if (!disposing|| Handle == IntPtr.Zero) + if (Handle == IntPtr.Zero) return; NativeMethods.cairo_pattern_destroy (Handle); diff --git a/cairo/Region.cs b/cairo/Region.cs index 3142fc046..f1d914be9 100644 --- a/cairo/Region.cs +++ b/cairo/Region.cs @@ -98,7 +98,7 @@ namespace Cairo if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing|| handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_region_destroy (Handle); diff --git a/cairo/ScaledFont.cs b/cairo/ScaledFont.cs index 179bbe5bc..25be1cd7b 100644 --- a/cairo/ScaledFont.cs +++ b/cairo/ScaledFont.cs @@ -116,7 +116,7 @@ namespace Cairo { if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing|| handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_scaled_font_destroy (handle); diff --git a/cairo/Surface.cs b/cairo/Surface.cs index c1411e1e5..959230327 100644 --- a/cairo/Surface.cs +++ b/cairo/Surface.cs @@ -147,7 +147,7 @@ namespace Cairo { if (!disposing || CairoDebug.Enabled) CairoDebug.OnDisposed (handle, disposing); - if (!disposing || handle == IntPtr.Zero) + if (handle == IntPtr.Zero) return; NativeMethods.cairo_surface_destroy (handle);