Another possible solution might be to do 2 things:

1. Set modal to nullptr only after calling disconnect
2. Showing the message only if model != nullptr and logging to console otherwise

So,

                d->modal = nullptr;
                WLApplication::emergency_save(game);
                d->game = nullptr;
                disconnect("CLIENT_CRASHED");
                // We will bounce back to the main menu, so we better log out
                if (internet_) {
                        InternetGaming::ref().logout("CLIENT_CRASHED");
                }

Could become

                WLApplication::emergency_save(game);
                d->game = nullptr;
                disconnect("CLIENT_CRASHED");
                // We will bounce back to the main menu, so we better log out
                if (internet_) {
                        InternetGaming::ref().logout("CLIENT_CRASHED");
                }
                d->modal = nullptr;

-- 
https://code.launchpad.net/~widelands-dev/widelands/bug_1794339_center_wo_parent/+merge/355873
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug_1794339_center_wo_parent into lp:widelands.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to