Author: spouliot
Date: 2006-07-06 08:52:15 -0400 (Thu, 06 Jul 2006)
New Revision: 62312
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/brush.c
trunk/libgdiplus/src/image.c
trunk/libgdiplus/src/solidbrush.c
Log:
2006-07-06 Sebastien Pouliot <[EMAIL PROTECTED]>
* brush.c: Remove empty and unused gdip_brush_destroy;
* image.c: Add missing calls to cairo_pattern_destroy when a previous
call to cairo_pattern_reference is made on a pattern;
* solidbrush.c: Add missing NULL checks for GdipCreateSolidFill and
GdipGetSolidFillColor functions and remove duplicate checks for
gdip_solidfill_destroy and gdip_solidfill_clone functions.
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2006-07-06 12:11:15 UTC (rev 62311)
+++ trunk/libgdiplus/src/ChangeLog 2006-07-06 12:52:15 UTC (rev 62312)
@@ -1,3 +1,12 @@
+2006-07-06 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * brush.c: Remove empty and unused gdip_brush_destroy;
+ * image.c: Add missing calls to cairo_pattern_destroy when a previous
+ call to cairo_pattern_reference is made on a pattern;
+ * solidbrush.c: Add missing NULL checks for GdipCreateSolidFill and
+ GdipGetSolidFillColor functions and remove duplicate checks for
+ gdip_solidfill_destroy and gdip_solidfill_clone functions.
+
2006-07-06 Sebastien Pouliot <[EMAIL PROTECTED]>
* image.c: Add missing NULL check to GdipDisposeImage.
Modified: trunk/libgdiplus/src/brush.c
===================================================================
--- trunk/libgdiplus/src/brush.c 2006-07-06 12:11:15 UTC (rev 62311)
+++ trunk/libgdiplus/src/brush.c 2006-07-06 12:52:15 UTC (rev 62312)
@@ -59,13 +59,6 @@
}
}
-GpStatus
-gdip_brush_destroy (GpBrush *brush)
-{
- /* do nothing, because we are not allocating any memory here. */
- return Ok;
-}
-
GpStatus
GdipCloneBrush (GpBrush *brush, GpBrush **clonedBrush)
{
Modified: trunk/libgdiplus/src/image.c
===================================================================
--- trunk/libgdiplus/src/image.c 2006-07-06 12:11:15 UTC (rev 62311)
+++ trunk/libgdiplus/src/image.c 2006-07-06 12:52:15 UTC (rev 62312)
@@ -229,6 +229,7 @@
cairo_paint (graphics->ct);
cairo_set_source(graphics->ct, org_pattern);
+ cairo_pattern_destroy (org_pattern);
cairo_pattern_destroy (pattern);
return Ok;
@@ -287,6 +288,7 @@
cairo_set_matrix (graphics->ct, &orig_matrix);
GdipDeleteMatrix (matrix);
+ cairo_pattern_destroy (org_pattern);
cairo_pattern_destroy (pattern);
return Ok;
@@ -481,6 +483,7 @@
cairo_matrix_init_identity (&mat);
cairo_pattern_set_matrix (pattern, &mat);
+ cairo_pattern_destroy(orig);
cairo_pattern_destroy(pattern);
if (flipXOn) {
@@ -526,6 +529,7 @@
cairo_fill (graphics->ct);
cairo_set_source(graphics->ct, orig);
+ cairo_pattern_destroy (orig);
cairo_matrix_init_identity (&mat);
cairo_pattern_set_matrix (pattern, &mat);
Modified: trunk/libgdiplus/src/solidbrush.c
===================================================================
--- trunk/libgdiplus/src/solidbrush.c 2006-07-06 12:11:15 UTC (rev 62311)
+++ trunk/libgdiplus/src/solidbrush.c 2006-07-06 12:52:15 UTC (rev 62312)
@@ -102,7 +102,7 @@
GpSolidFill *result;
GpSolidFill *solid;
- g_return_val_if_fail (brush != NULL, InvalidParameter);
+ /* the NULL checks for brush and clonedBrush are done by the caller,
GdipCloneBrush */
result = (GpSolidFill *) GdipAlloc (sizeof (GpSolidFill));
@@ -122,7 +122,7 @@
GpStatus
gdip_solidfill_destroy (GpBrush *brush)
{
- g_return_val_if_fail (brush != NULL, InvalidParameter);
+ /* the NULL check for brush is done by the caller, GdipDeleteBrush */
GdipFree (brush);
@@ -132,6 +132,9 @@
GpStatus
GdipCreateSolidFill (int color, GpSolidFill **brush)
{
+ if (!brush)
+ return InvalidParameter;
+
*brush = gdip_solidfill_new ();
g_return_val_if_fail (*brush != NULL, OutOfMemory);
@@ -154,7 +157,8 @@
GpStatus
GdipGetSolidFillColor (GpSolidFill *brush, int *color)
{
- g_return_val_if_fail (brush != NULL, InvalidParameter);
+ if (!brush || !color)
+ return InvalidParameter;
*color = brush->color;
return Ok;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches