diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-13 21:43:55 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-13 21:43:55 +0000 |
| commit | 6973283a77d7becd6a5a1bd7396206c6840ca785 (patch) | |
| tree | 548ecd769aee550eb36b1ccfce7bcc95651ccdd9 /src/display/cairo-utils.cpp | |
| parent | UI fixes for gcodetools extension (diff) | |
| download | inkscape-6973283a77d7becd6a5a1bd7396206c6840ca785.tar.gz inkscape-6973283a77d7becd6a5a1bd7396206c6840ca785.zip | |
Fix crashes in print preview
Fixed bugs:
- https://launchpad.net/bugs/806105
(bzr r10450)
Diffstat (limited to 'src/display/cairo-utils.cpp')
| -rw-r--r-- | src/display/cairo-utils.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp index 90f65c33e..8b75f09a6 100644 --- a/src/display/cairo-utils.cpp +++ b/src/display/cairo-utils.cpp @@ -345,6 +345,18 @@ ink_cairo_surface_create_for_argb32_pixbuf(GdkPixbuf *pb) return pbs; } +/** @brief Cleanup function for GdkPixbuf. + * This function should be passed as the GdkPixbufDestroyNotify parameter + * to gdk_pixbuf_new_from_data when creating a GdkPixbuf backed by + * a Cairo surface. + */ +void +ink_cairo_pixbuf_cleanup(guchar *pixels, void *data) +{ + cairo_surface_t *surface = reinterpret_cast<cairo_surface_t*>(data); + cairo_surface_destroy(surface); +} + /** @brief Create an exact copy of a surface. * Creates a surface that has the same type, content type, dimensions and contents * as the specified surface. */ |
