summaryrefslogtreecommitdiffstats
path: root/src/extension/system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/extension/system.cpp')
-rw-r--r--src/extension/system.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index a7828d3fc..33ee544a1 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -277,7 +277,19 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
doc->setModifiedSinceSave(false);
}
- omod->save(doc, fileName);
+ try {
+ omod->save(doc, fileName);
+ }
+ catch(...) {
+ // free used ressources
+ if ( !official) {
+ g_free(saved_output_extension);
+ g_free(saved_dataloss);
+ }
+ g_free(fileName);
+
+ throw Inkscape::Extension::Output::save_failed();
+ }
// If it is an unofficial save, set the modified attributes back to what they were.
if ( !official) {