fixed qt assert when importing files
This commit is contained in:
@@ -89,14 +89,15 @@ NodeAddCommand::NodeAddCommand(NodeGraph *graph, Node *node) :
|
||||
graph_(graph),
|
||||
node_(node)
|
||||
{
|
||||
if (memory_manager_.thread() != node->thread()) {
|
||||
memory_manager_.moveToThread(node_->thread());
|
||||
}
|
||||
|
||||
// Ensures that when this command is destroyed, if redo() is never called again, the node will be destroyed too
|
||||
node_->setParent(&memory_manager_);
|
||||
}
|
||||
|
||||
void NodeAddCommand::PushToThread(QThread *thread)
|
||||
{
|
||||
memory_manager_.moveToThread(thread);
|
||||
}
|
||||
|
||||
void NodeAddCommand::redo()
|
||||
{
|
||||
node_->setParent(graph_);
|
||||
|
||||
@@ -76,6 +76,8 @@ class NodeAddCommand : public UndoCommand {
|
||||
public:
|
||||
NodeAddCommand(NodeGraph* graph, Node* node);
|
||||
|
||||
void PushToThread(QThread* thread);
|
||||
|
||||
virtual Project* GetRelevantProject() const override;
|
||||
|
||||
virtual void redo() override;
|
||||
|
||||
Reference in New Issue
Block a user