diff --git a/src/storm/storage/expressions/Variable.cpp b/src/storm/storage/expressions/Variable.cpp index 0259ab3e5..675f1caef 100644 --- a/src/storm/storage/expressions/Variable.cpp +++ b/src/storm/storage/expressions/Variable.cpp @@ -16,7 +16,7 @@ namespace storm { } bool Variable::operator==(Variable const& other) const { - return manager == other.manager && index == other.index; + return &this->getManager() == &other.getManager() && index == other.index; } bool Variable::operator!=(Variable const& other) const { @@ -48,8 +48,7 @@ namespace storm { } ExpressionManager const& Variable::getManager() const { - STORM_LOG_ASSERT(manager != nullptr, "Manager is null."); - return *manager; + return *manager.lock(); } bool Variable::hasBooleanType() const { diff --git a/src/storm/storage/expressions/Variable.h b/src/storm/storage/expressions/Variable.h index 8a51df376..3ecea02c0 100644 --- a/src/storm/storage/expressions/Variable.h +++ b/src/storm/storage/expressions/Variable.h @@ -138,7 +138,7 @@ namespace storm { private: // The manager that is responsible for this variable. - std::shared_ptr manager; + std::weak_ptr manager; // The index of the variable. uint_fast64_t index;