Commit 02b525bb authored by Dominik Charousset's avatar Dominik Charousset

Fix accessing incompletely constructed derived ptr

parent 628fdab2
......@@ -54,7 +54,7 @@ public:
// -- overridden functions of monitorable_actor ------------------------------
bool cleanup(error&& fail_state, execution_unit* ptr) override {
auto me = dptr()->ctrl();
auto me = this->ctrl();
for (auto& subscription : subscriptions_)
subscription->unsubscribe(me);
subscriptions_.clear();
......@@ -69,7 +69,7 @@ public:
CAF_LOG_TRACE(CAF_ARG(what));
if (what == invalid_group)
return;
if (what->subscribe(dptr()->ctrl()))
if (what->subscribe(this->ctrl()))
subscriptions_.emplace(what);
}
......@@ -77,7 +77,7 @@ public:
void leave(const group& what) {
CAF_LOG_TRACE(CAF_ARG(what));
if (subscriptions_.erase(what) > 0)
what->unsubscribe(dptr()->ctrl());
what->unsubscribe(this->ctrl());
}
/// Returns all subscribed groups.
......@@ -86,10 +86,6 @@ public:
}
private:
Subtype* dptr() {
return static_cast<Subtype*>(this);
}
// -- data members -----------------------------------------------------------
/// Stores all subscribed groups.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment