From 174f73f9058dca494ddbb2052197fb753e8aab20 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sat, 27 Jan 2007 04:22:49 +0000 Subject: [PATCH] Further readonly handle work and comments --- src/FontFace.cs | 6 +----- src/FontOptions.cs | 1 + src/Pattern.cs | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/FontFace.cs b/src/FontFace.cs index a9309da..e018e13 100644 --- a/src/FontFace.cs +++ b/src/FontFace.cs @@ -4,7 +4,7 @@ namespace Cairo { public class FontFace : IDisposable { - IntPtr handle; + readonly IntPtr handle; internal static FontFace Lookup (IntPtr handle, bool owns) { @@ -36,11 +36,7 @@ namespace Cairo void Dispose (bool disposing) { - if (handle == IntPtr.Zero) - return; - NativeMethods.cairo_font_face_destroy (handle); - handle = IntPtr.Zero; } public IntPtr Handle { diff --git a/src/FontOptions.cs b/src/FontOptions.cs index 476910f..f7df28a 100644 --- a/src/FontOptions.cs +++ b/src/FontOptions.cs @@ -32,6 +32,7 @@ namespace Cairo { public class FontOptions : IDisposable { + //TODO: review memory management and make handle readonly IntPtr handle; bool disposed; diff --git a/src/Pattern.cs b/src/Pattern.cs index 5e77e7a..fff055f 100644 --- a/src/Pattern.cs +++ b/src/Pattern.cs @@ -33,6 +33,7 @@ namespace Cairo { public class Pattern : IDisposable { + //TODO: review memory management and make handle readonly protected IntPtr handle = IntPtr.Zero; internal static Pattern Lookup (IntPtr handle, bool owns) -- 2.11.4.GIT