# HG changeset patch # User insilmaril # Date 1216209404 0 # Node ID 462d3950227337b6b6c460280e174afec93189c2 # Parent 12958f987bcf8ed9595994c5354643224757694e no more segfault when deleting animated part diff -r 12958f987bcf -r 462d39502273 branchobj.cpp --- a/branchobj.cpp Wed Jul 16 10:46:14 2008 +0000 +++ b/branchobj.cpp Wed Jul 16 11:56:44 2008 +0000 @@ -53,6 +53,13 @@ BranchObj::~BranchObj () { + // If I'm animated, I need to un-animate myself first + if (anim.isAnimated() ) + { + anim.setAnimated (false); + model->stopAnimation (this); + } + //cout << "Destr BranchObj of "<getParObj(); selection.unselect(); saveStateRemovingPart (bo, QString ("Delete %1").arg(getObjectName(bo))); @@ -4063,6 +4064,13 @@ } } +void VymModel::stopAnimation (MapObj *mo) +{ + int i=animObjList.indexOf(mo); + if (i>=0) + animObjList.removeAt (i); +} + void VymModel::sendSelection() { if (netstate!=Server) return; diff -r 12958f987bcf -r 462d39502273 vymmodel.h --- a/vymmodel.h Wed Jul 16 10:46:14 2008 +0000 +++ b/vymmodel.h Wed Jul 16 11:56:44 2008 +0000 @@ -223,8 +223,6 @@ LinkableMapObj* findObjBySelect (const QString &s); // find MapObj by select string LinkableMapObj* findID (const QString &s); // find MapObj by previously set ID - void removeSelection (); // remove selected object - QString saveToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir @@ -464,6 +462,8 @@ void animate(); //!< Called by timer to animate stuff public: void startAnimation(const QPointF &start, const QPointF &dest); + void stopAnimation(MapObj *mo); + //////////////////////////////////////////// // Network related ////////////////////////////////////////////