Code

remove lpeobject_ref when invalid lpe name
authorjohanengelen <johanengelen@users.sourceforge.net>
Tue, 23 Sep 2008 21:38:42 +0000 (21:38 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Tue, 23 Sep 2008 21:38:42 +0000 (21:38 +0000)
src/sp-lpe-item.cpp

index 89d41be76a5d0d497e5aa4c079b2fd756ba84cdd..2b0379cd4b86475106146c93db69035491eef282 100644 (file)
@@ -217,6 +217,11 @@ sp_lpe_item_set(SPObject *object, unsigned int key, gchar const *value)
 
                         if (path_effect_ref && path_effect_ref->lpeobject && path_effect_ref->lpeobject->lpe) {
                             lpeitem->path_effect_list->push_back(path_effect_ref);
+                        } else {
+                            // something has gone wrong in finding the right patheffect. For example when the specified LPE name does not exist.
+                            path_effect_ref->unlink();
+                            delete path_effect_ref;
+                            path_effect_ref = NULL;
                         }
                     }
                 }