Commit 970a1b2a authored by Dominik Charousset's avatar Dominik Charousset

Merge pull request #1337

parents b583e61d dd55f12f
...@@ -15,6 +15,7 @@ is based on [Keep a Changelog](https://keepachangelog.com). ...@@ -15,6 +15,7 @@ is based on [Keep a Changelog](https://keepachangelog.com).
the closing parenthesis. the closing parenthesis.
- The JSON reader now automatically widens integers to doubles as necessary. - The JSON reader now automatically widens integers to doubles as necessary.
- Module options (e.g. for the `middleman`) now show up in `--long-help` output. - Module options (e.g. for the `middleman`) now show up in `--long-help` output.
- Fix undefined behavior in the Qt group chat example (#1336).
### Changed ### Changed
......
...@@ -36,11 +36,12 @@ public: ...@@ -36,11 +36,12 @@ public:
~actor_widget() { ~actor_widget() {
if (companion_) if (companion_)
self()->cleanup(error{}, &dummy_); 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