2007-07-07 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Sat, 7 Jul 2007 17:30:07 +0000 (17:30 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 7 Jul 2007 17:30:07 +0000 (17:30 -0000)
* Mono.Cairo/Context.cs: Fix leak of the surface if set with
Target .

svn path=/trunk/mcs/; revision=81569

mcs/class/Mono.Cairo/ChangeLog
mcs/class/Mono.Cairo/Mono.Cairo/Context.cs

index 9195afe3c6ac394b41cc790083e72bfb2d24dc5e..8e7ce02aacbac3350f57cebe0718616c26d795d8 100644 (file)
@@ -1,7 +1,9 @@
 2007-07-07  Miguel de Icaza  <miguel@novell.com>
 
-       * Mono.Cairo/Context.cs: From Alp Toker: new SetSourceOveload with
-       no x, y parameters.
+       * Mono.Cairo/Context.cs: Fix leak of the surface if set with
+       Target .
+
+       From Alp Toker: new SetSourceOveload with no x, y parameters.
 
        From Alp Toker: Add new API call IdentityMatrix.
 
index 056abb8660981c9216fcd472586fe8e102f20dd1..f53052753b85fa445c7dd9e557e9daef959db457 100644 (file)
@@ -361,6 +361,9 @@ namespace Cairo {
 
                 public Cairo.Surface Target {
                         set {
+                               if (state != IntPtr.Zero)
+                                       NativeMethods.cairo_destroy (state);
+                               
                                state = NativeMethods.cairo_create (value.Handle);
                         }