Author: spouliot
Date: 2006-03-20 13:56:38 -0500 (Mon, 20 Mar 2006)
New Revision: 58194

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/pen.c
Log:
pen.c: Use the GDI+ call to create the matrix (GdipCreateMatrix). Delete the 
default (empty) matrix when cloning a pen. Delete the matrix when disposing of 
the pen.

Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-03-20 17:56:52 UTC (rev 58193)
+++ trunk/libgdiplus/src/ChangeLog      2006-03-20 18:56:38 UTC (rev 58194)
@@ -1,3 +1,9 @@
+2006-03-20  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * pen.c: Use the GDI+ call to create the matrix (GdipCreateMatrix).
+       Delete the default (empty) matrix when cloning a pen. Delete the
+       matrix when disposing of the pen.
+
 2006-03-19  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * lineargradientbrush.c: The GpRect structure was never freed in 

Modified: trunk/libgdiplus/src/pen.c
===================================================================
--- trunk/libgdiplus/src/pen.c  2006-03-20 17:56:52 UTC (rev 58193)
+++ trunk/libgdiplus/src/pen.c  2006-03-20 18:56:38 UTC (rev 58194)
@@ -48,8 +48,7 @@
        pen->compound_array = NULL;
        pen->unit = UnitWorld;
        pen->changed = TRUE;
-       pen->matrix = NULL;
-       pen->matrix = g_new (GpMatrix, 1);
+       GdipCreateMatrix (&pen->matrix);
        cairo_matrix_init_identity (pen->matrix);
 }
 
@@ -337,7 +336,9 @@
        result->compound_count = pen->compound_count;
        result->compound_array = compound_array;
        result->unit = pen->unit;
-        gdip_cairo_matrix_copy(result->matrix, matrix);
+       if (result->matrix)
+               GdipDeleteMatrix (result->matrix);
+       result->matrix = matrix;
        result->changed = pen->changed;
 
         *clonepen = result;
@@ -356,13 +357,22 @@
                pen->dash_array = NULL;
        }
 
-       if (pen->own_brush && pen->brush)
+       if (pen->own_brush && pen->brush) {
                GdipFree (pen->brush);
+               pen->brush = NULL;
+       }
 
-        if (pen->compound_count != 0)
+        if (pen->compound_count != 0) {
                 GdipFree (pen->compound_array);
-       pen->compound_array = NULL;
+               pen->compound_array = NULL;
+               pen->compound_count = 0;
+       }
 
+       if (pen->matrix) {
+               GdipDeleteMatrix (pen->matrix);
+               pen->matrix = NULL;
+       }
+
         GdipFree (pen);
 
        return Ok;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to