Code review comment for lp:~widelands-dev/widelands/bug_1794339_center_wo_parent

Revision history for this message
GunChleoc (gunchleoc) wrote :

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;

« Back to merge proposal