fix crash when saving a document after aborting a pending transaction
This commit is contained in:
@@ -494,6 +494,10 @@ Offset::Offset()
|
||||
ADD_PROPERTY_TYPE(Fill,(false),"Offset",App::Prop_None,"Fill offset");
|
||||
}
|
||||
|
||||
Offset::~Offset()
|
||||
{
|
||||
}
|
||||
|
||||
short Offset::mustExecute() const
|
||||
{
|
||||
if (Source.isTouched())
|
||||
|
||||
@@ -121,6 +121,7 @@ class Offset : public Part::Feature
|
||||
|
||||
public:
|
||||
Offset();
|
||||
~Offset();
|
||||
|
||||
App::PropertyLink Source;
|
||||
App::PropertyFloat Value;
|
||||
|
||||
@@ -56,6 +56,14 @@ class DocumentBasicCases(unittest.TestCase):
|
||||
self.Doc.undo()
|
||||
self.Doc.undo()
|
||||
|
||||
def testAbortTransaction(self):
|
||||
self.Doc.openTransaction("Add")
|
||||
obj=self.Doc.addObject("App::FeatureTest","Label")
|
||||
self.Doc.abortTransaction()
|
||||
TempPath = tempfile.gettempdir()
|
||||
SaveName = TempPath + os.sep + "SaveRestoreTests.FCStd"
|
||||
self.Doc.saveAs(SaveName)
|
||||
|
||||
def testRemoval(self):
|
||||
# Cannot write a real test case for that but when debugging the
|
||||
# C-code there shouldn't be a memory leak (see rev. 1814)
|
||||
|
||||
Reference in New Issue
Block a user