diff options
| author | theAdib <theAdib@users.sourceforge.net> | 2009-01-25 21:20:52 +0000 |
|---|---|---|
| committer | theAdib <theAdib@users.sourceforge.net> | 2009-01-25 21:20:52 +0000 |
| commit | 2309e0eee302bfc37e0af157c5aa1393fb7209c6 (patch) | |
| tree | 60294296a9774bf9ca91994072eabaeafe8a482d /src/sp-object.cpp | |
| parent | Remove the source snap-indicator when ungrabbing (diff) | |
| download | inkscape-2309e0eee302bfc37e0af157c5aa1393fb7209c6.tar.gz inkscape-2309e0eee302bfc37e0af157c5aa1393fb7209c6.zip | |
prevent inkscape from crashing in case of malformed SVG, still need method to inform the user about document corruption
(bzr r7176)
Diffstat (limited to 'src/sp-object.cpp')
| -rw-r--r-- | src/sp-object.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 0153fedc2..1e7c5f2fe 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -1295,8 +1295,20 @@ SPObject::updateDisplay(SPCtx *ctx, unsigned int flags) } } - if (((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update) - ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update(this, ctx, flags); + try + { + if (((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update) + ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update(this, ctx, flags); + } + catch(...) + { + /** \todo + * in case of catching an exception we need to inform the user somehow that the document is corrupted + * maybe by implementing an document flag documentOk + * or by a modal error dialog + */ + g_warning("SPObject::updateDisplay(SPCtx *ctx, unsigned int flags) : throw in ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update(this, ctx, flags);"); + } update_in_progress --; } |
