View Issue Details

IDProjectCategoryView StatusLast Update
0000525FreeCADBugpublic2011-12-21 16:09
ReporterwmayerAssigned ToJriegel 
PriorityhighSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target Version0.12Fixed in Version0.13 
Summary0000525: Crash when doing an undo of an already deleted object
Descriptiondoc=App.newDocument()
doc.openTransaction()
obj=doc.addObject("Part::Box","Box")
doc.recompute()
doc.commitTransaction()
doc.removeObject(obj.Name)
doc.undo()
TagsNo tags attached.

Activities

yorik

2011-12-07 17:34

administrator   ~0001417

In the example above, if I remove doc.recompute() from the transaction (commit before), I get no crash, but this message (but the undo is not done):

FC++ exception thrown (basic_string::_S_construct null not valid

Jriegel

2011-12-07 18:37

administrator   ~0001418

Yes, I already know where the problem is!

Jriegel

2011-12-07 20:25

administrator   ~0001419

fixed with R5232

wmayer

2011-12-08 07:54

administrator   ~0001420

close item

wmayer

2011-12-15 11:32

administrator   ~0001482

The crash is fixed but now for every transaction two items appear in the undo list. The first transaction has the actual command name and the second one has an empty name.

If doing some modelling before and then do some undo, redo, undo this leads to a completely messed up document. And e.g. if you open a document, do a change somewhere and run the undo this causes some object to completely disappear.

IMO it's very dangerous to open a transaction inside Document::onBeforeChangeProperty() and Document::_addObject() because it automatically creates a transaction where is not supposed to be one like opening a document.

wmayer

2011-12-21 16:09

administrator   ~0001508

Removing _checkTransaction() from onBeforeChangeProperty(), _addObject() and recomputeFeature() solved the new problems.

Fixed with rev 5334

Issue History

Date Modified Username Field Change
2011-12-07 16:13 wmayer New Issue
2011-12-07 16:13 wmayer Status new => assigned
2011-12-07 16:13 wmayer Assigned To => Jriegel
2011-12-07 17:34 yorik Note Added: 0001417
2011-12-07 18:37 Jriegel Note Added: 0001418
2011-12-07 18:37 Jriegel Status assigned => acknowledged
2011-12-07 18:41 Jriegel Priority normal => high
2011-12-07 18:41 Jriegel Target Version => 0.12
2011-12-07 20:25 Jriegel Note Added: 0001419
2011-12-07 20:25 Jriegel Status acknowledged => resolved
2011-12-07 20:25 Jriegel Fixed in Version => 0.13
2011-12-07 20:25 Jriegel Resolution open => fixed
2011-12-08 07:54 wmayer Note Added: 0001420
2011-12-08 07:54 wmayer Status resolved => closed
2011-12-15 11:32 wmayer Note Added: 0001482
2011-12-15 11:32 wmayer Status closed => assigned
2011-12-15 11:32 wmayer Resolution fixed => reopened
2011-12-21 16:09 wmayer Note Added: 0001508
2011-12-21 16:09 wmayer Status assigned => closed
2011-12-21 16:09 wmayer Resolution reopened => fixed