Fix parent pointer corruption in intoGroup

This appears to be what caused group movement related segfaults.
This commit is contained in:
outfoxxed 2023-05-04 11:27:10 -07:00
parent 43a4aa2b16
commit f12993ecf0
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -355,12 +355,13 @@ Hy3Node* Hy3Node::removeFromParentRecursive() {
Hy3Node* Hy3Node::intoGroup(Hy3GroupLayout layout) {
this->layout->nodes.push_back({
.parent = this,
.data = this->data,
.data = layout,
.workspace_id = this->workspace_id,
.layout = this->layout,
});
auto* node = &this->layout->nodes.back();
swapData(*this, *node);
this->data = layout;
this->data.as_group.children.push_back(node);