Merge lp:~widelands-dev/widelands/bug-1735967-productionsitewindow into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8531
Proposed branch: lp:~widelands-dev/widelands/bug-1735967-productionsitewindow
Merge into: lp:widelands
Diff against target: 13 lines (+3/-0)
1 file modified
src/wui/productionsitewindow.cc (+3/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1735967-productionsitewindow
Reviewer Review Type Date Requested Status
TiborB Approve
Review via email: mp+335020@code.launchpad.net

Commit message

Productionsite windows no longer handle their notifications when they are dying. This will hopefully fix a use-after-free when the worker table is updated while the window is being closed.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2947. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/314698452.
Appveyor build 2756. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1735967_productionsitewindow-2756.

Revision history for this message
TiborB (tiborb95) wrote :

Code looks good to me. Only indentation seems be shifted to the right, at least here on this page

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

Yes, QTCreator annoyingly does that, and I haven't found a setting to make it behave. Bunnybot will fix it for us though :)

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/productionsitewindow.cc'
2--- src/wui/productionsitewindow.cc 2017-11-30 20:56:22 +0000
3+++ src/wui/productionsitewindow.cc 2017-12-11 09:54:02 +0000
4@@ -48,6 +48,9 @@
5 worker_caps_(nullptr) {
6 productionsitenotes_subscriber_ = Notifications::subscribe<Widelands::NoteBuilding>(
7 [this](const Widelands::NoteBuilding& note) {
8+ if (is_dying_) {
9+ return;
10+ }
11 Widelands::ProductionSite* production_site = production_site_.get(igbase()->egbase());
12 if (production_site == nullptr) {
13 return;

Subscribers

People subscribed via source and target branches

to status/vote changes: