summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2013-01-23 21:18:32 +0000
committerKris <Kris.De.Gussem@hotmail.com>2013-01-23 21:18:32 +0000
commita695510ee8752fee48b98f7b4177115876a0a3a6 (patch)
treeb36a9c98ee45ab65a9b02c7e4c0974fee8c35bf1 /src
parentcppcheck: style and performance (diff)
downloadinkscape-a695510ee8752fee48b98f7b4177115876a0a3a6.tar.gz
inkscape-a695510ee8752fee48b98f7b4177115876a0a3a6.zip
fix Memory leak in bitmap trace (Bug #996695)
(bzr r12057)
Diffstat (limited to 'src')
-rw-r--r--src/trace/imagemap-gdk.cpp14
-rw-r--r--src/trace/imagemap-gdk.h4
2 files changed, 10 insertions, 8 deletions
diff --git a/src/trace/imagemap-gdk.cpp b/src/trace/imagemap-gdk.cpp
index e5ff23ad0..06f355de7 100644
--- a/src/trace/imagemap-gdk.cpp
+++ b/src/trace/imagemap-gdk.cpp
@@ -58,7 +58,7 @@ GdkPixbuf *grayMapToGdkPixbuf(GrayMap *grayMap)
GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB,
0, 8, grayMap->width, grayMap->height,
- rowstride, NULL, NULL);
+ rowstride, (GdkPixbufDestroyNotify)g_free, NULL);
//### Fill in the odd cells with RGB values
int x,y;
@@ -122,7 +122,7 @@ PackedPixelMap *gdkPixbufToPackedPixelMap(GdkPixbuf *buf)
return ppMap;
}
-GdkPixbuf *packedPixelMapToGdkPixbuf(PackedPixelMap *ppMap)
+/*GdkPixbuf *packedPixelMapToGdkPixbuf(PackedPixelMap *ppMap)
{
if (!ppMap)
return NULL;
@@ -137,7 +137,7 @@ GdkPixbuf *packedPixelMapToGdkPixbuf(PackedPixelMap *ppMap)
GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB,
0, 8, ppMap->width, ppMap->height,
- rowstride, NULL, NULL);
+ rowstride, NULL, NULL); //first NULL: replace by (GdkPixbufDestroyNotify)g_free ??
//### Fill in the cells with RGB values
int x,y;
@@ -158,7 +158,7 @@ GdkPixbuf *packedPixelMapToGdkPixbuf(PackedPixelMap *ppMap)
return buf;
}
-
+*/
/*#########################################################################
@@ -203,6 +203,7 @@ RgbMap *gdkPixbufToRgbMap(GdkPixbuf *buf)
return rgbMap;
}
+/*
GdkPixbuf *rgbMapToGdkPixbuf(RgbMap *rgbMap)
{
if (!rgbMap)
@@ -218,7 +219,7 @@ GdkPixbuf *rgbMapToGdkPixbuf(RgbMap *rgbMap)
GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB,
0, 8, rgbMap->width, rgbMap->height,
- rowstride, NULL, NULL);
+ rowstride, NULL, NULL); //first NULL: replace by (GdkPixbufDestroyNotify)g_free ??
//### Fill in the cells with RGB values
int x,y;
@@ -239,6 +240,7 @@ GdkPixbuf *rgbMapToGdkPixbuf(RgbMap *rgbMap)
return buf;
}
+*/
/*#########################################################################
## I N D E X E D M A P
@@ -260,7 +262,7 @@ GdkPixbuf *indexedMapToGdkPixbuf(IndexedMap *iMap)
GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB,
0, 8, iMap->width, iMap->height,
- rowstride, NULL, NULL);
+ rowstride, (GdkPixbufDestroyNotify)g_free, NULL);
//### Fill in the cells with RGB values
int x,y;
diff --git a/src/trace/imagemap-gdk.h b/src/trace/imagemap-gdk.h
index d04a84d8e..3b4631f50 100644
--- a/src/trace/imagemap-gdk.h
+++ b/src/trace/imagemap-gdk.h
@@ -29,11 +29,11 @@ GdkPixbuf *grayMapToGdkPixbuf(GrayMap *grayMap);
PackedPixelMap *gdkPixbufToPackedPixelMap(GdkPixbuf *buf);
-GdkPixbuf *packedPixelMapToGdkPixbuf(PackedPixelMap *ppMap);
+//GdkPixbuf *packedPixelMapToGdkPixbuf(PackedPixelMap *ppMap);
RgbMap *gdkPixbufToRgbMap(GdkPixbuf *buf);
-GdkPixbuf *rgbMapToGdkPixbuf(RgbMap *rgbMap);
+//GdkPixbuf *rgbMapToGdkPixbuf(RgbMap *rgbMap);
GdkPixbuf *indexedMapToGdkPixbuf(IndexedMap *iMap);