Re-enabled intrusive_ptr

This commit is contained in:
Twan van Laarhoven
2020-05-07 22:25:02 +02:00
parent 360f8d71ad
commit 8b25815f72
7 changed files with 99 additions and 49 deletions
+2 -14
View File
@@ -134,20 +134,8 @@ void SetScriptManager::initDependencies(Context& ctx, StyleSheet& stylesheet) {
void SetScriptManager::onAction(const Action& action, bool undone) {
TYPE_CASE(action, ValueAction) {
if (action.card) {
#ifdef USE_INTRUSIVE_PTR
// we can just turn the Card* into a CardP
updateValue(*action.valueP, CardP(const_cast<Card*>(action.card)));
return;
#else
// find the affected card
FOR_EACH(card, set.cards) {
if (card->data.contains(action.valueP)) {
updateValue(*action.valueP, card);
return;
}
}
assert(false);
#endif
updateValue(*action.valueP, const_cast<Card*>(action.card)->intrusive_from_this());
return;
} else {
// is it a keyword's fake value?
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());