Commit 43ad9c53 authored by Al Crate's avatar Al Crate

Rename variable and init properly.

parent fe848674
...@@ -36,11 +36,12 @@ public: ...@@ -36,11 +36,12 @@ public:
~actor_widget() { ~actor_widget() {
if (companion_) if (companion_)
self()->cleanup(error{}, self()->system().dummy_execution_unit()); self()->cleanup(error{}, &execution_unit_);
} }
void init(actor_system& system) { void init(actor_system& system) {
alive_ = true; alive_ = true;
execution_unit_.system_ptr(&system);
companion_ = actor_cast<strong_actor_ptr>(system.spawn<actor_companion>()); companion_ = actor_cast<strong_actor_ptr>(system.spawn<actor_companion>());
self()->on_enqueue([=](mailbox_element_ptr ptr) { self()->on_enqueue([=](mailbox_element_ptr ptr) {
qApp->postEvent(this, new event_type(std::move(ptr))); qApp->postEvent(this, new event_type(std::move(ptr)));
...@@ -66,7 +67,7 @@ public: ...@@ -66,7 +67,7 @@ public:
if (event->type() == static_cast<QEvent::Type>(EventId)) { if (event->type() == static_cast<QEvent::Type>(EventId)) {
auto ptr = dynamic_cast<event_type*>(event); auto ptr = dynamic_cast<event_type*>(event);
if (ptr && alive_) { if (ptr && alive_) {
switch (self()->activate(&dummy_, *(ptr->mptr))) { switch (self()->activate(&execution_unit_, *(ptr->mptr))) {
default: default:
break; break;
}; };
...@@ -89,7 +90,7 @@ public: ...@@ -89,7 +90,7 @@ public:
} }
private: private:
scoped_execution_unit dummy_; scoped_execution_unit execution_unit_;
strong_actor_ptr companion_; strong_actor_ptr companion_;
bool alive_; bool alive_;
}; };
......
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