App: add class TransactionLocker
To protect some critical transaction from being closed prematurely. It is currently used to protect transaction of object deletion.
This commit is contained in:
@@ -91,6 +91,7 @@ recompute path. Also, it enables more complicated dependencies beyond trees.
|
||||
#include <QCoreApplication>
|
||||
#include <QCryptographicHash>
|
||||
|
||||
#include "AutoTransaction.h"
|
||||
#include "Document.h"
|
||||
#include "Application.h"
|
||||
#include "DocumentObject.h"
|
||||
@@ -3764,6 +3765,8 @@ void Document::removeObject(const char* sName)
|
||||
return;
|
||||
}
|
||||
|
||||
TransactionLocker tlock;
|
||||
|
||||
_checkTransaction(pos->second,0,__LINE__);
|
||||
|
||||
#if 0
|
||||
@@ -3865,6 +3868,8 @@ void Document::_removeObject(DocumentObject* pcObject)
|
||||
return;
|
||||
}
|
||||
|
||||
TransactionLocker tlock;
|
||||
|
||||
// TODO Refactoring: share code with Document::removeObject() (2015-09-01, Fat-Zer)
|
||||
_checkTransaction(pcObject,0,__LINE__);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user