patterns: Fixed crash when using attributes
This commit is contained in:
parent
39da62532b
commit
2880ca00da
@ -44,8 +44,10 @@ namespace hex::pl {
|
|||||||
Attributable(const Attributable &other) {
|
Attributable(const Attributable &other) {
|
||||||
for (auto &attribute : other.m_attributes) {
|
for (auto &attribute : other.m_attributes) {
|
||||||
auto copy = attribute->clone();
|
auto copy = attribute->clone();
|
||||||
if (auto node = dynamic_cast<ASTNodeAttribute *>(copy.get()))
|
if (auto node = dynamic_cast<ASTNodeAttribute *>(copy.get())) {
|
||||||
this->m_attributes.push_back(std::unique_ptr<ASTNodeAttribute>(node));
|
this->m_attributes.push_back(std::unique_ptr<ASTNodeAttribute>(node));
|
||||||
|
(void)copy.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user