summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2013-08-21 11:01:40 +0000
committerKris <Kris.De.Gussem@hotmail.com>2013-08-21 11:01:40 +0000
commit350476a133a3965b1d7047d2f0f05bf809b177ba (patch)
treee37c3b5fe56ffd53d5420823a74ff64f22ee4cfa /src
parentPrevent writing out empty style strings. (diff)
downloadinkscape-350476a133a3965b1d7047d2f0f05bf809b177ba.tar.gz
inkscape-350476a133a3965b1d7047d2f0f05bf809b177ba.zip
better memory leak fix (fixes bug 986271: memory leaks associated with images)
Patch by David Mathog, including revert of former fix in rev 11268 (bzr r12482)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/emf-win32-print.cpp12
-rw-r--r--src/extension/internal/emf-win32-print.h7
-rw-r--r--src/sp-image.cpp1
3 files changed, 1 insertions, 19 deletions
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index 621954f68..92f564078 100644
--- a/src/extension/internal/emf-win32-print.cpp
+++ b/src/extension/internal/emf-win32-print.cpp
@@ -910,18 +910,6 @@ void PrintEmfWin32::init (void)
return;
}
-unsigned int PrintEmfWin32::image(Inkscape::Extension::Print * /* module */, /** not used */
- unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */
- unsigned int /*w*/, /** width of bitmap */
- unsigned int /*h*/, /** height of bitmap */
- unsigned int /*rs*/, /** row stride (normally w*4) */
- Geom::Affine const & /*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */
- SPStyle const * /*style*/) /** provides indirect link to image object */
-{
- free(px);
- return 0;
-}
-
} /* namespace Internal */
} /* namespace Extension */
} /* namespace Inkscape */
diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h
index e7bd08477..bbeeeb051 100644
--- a/src/extension/internal/emf-win32-print.h
+++ b/src/extension/internal/emf-win32-print.h
@@ -50,13 +50,6 @@ class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation
unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Affine &transform);
bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Affine &transform);
- unsigned int image(Inkscape::Extension::Print * /* module */, /** not used */
- unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */
- unsigned int w, /** width of bitmap */
- unsigned int h, /** height of bitmap */
- unsigned int rs, /** row stride (normally w*4) */
- Geom::Affine const &tf_ignore, /** WRONG affine transform, use the one from m_tr_stack */
- SPStyle const *style); /** provides indirect link to image object */
public:
PrintEmfWin32 (void);
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index d60fbc181..10d294d5c 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -1056,6 +1056,7 @@ static void sp_image_print( SPItem *item, SPPrintContext *ctx )
t = ti * t;
sp_print_image_R8G8B8A8_N(ctx, px + trimx*pixskip + trimy*rs, trimwidth, trimheight, rs, t, item->style);
}
+ free(px); // else big memory leak on each image print!
}
}