Skip to content

Commit

Permalink
Fixed|Client|Windows: Potential crash if closing window during startup
Browse files Browse the repository at this point in the history
When game resources are being located, games become current for short
periods of time (kludge in Games::locateStartupResources()). If a
"quit" command happened to be executed at this time, a crash could
occur in the console command execution, presumably if the game suddenly
was removed in another thread.

As a workaround, closing the window is disallowed during busy mode.

IssueID #1895
  • Loading branch information
skyjake committed Nov 15, 2014
1 parent 30d72c3 commit abca343
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -810,10 +810,13 @@ void ClientWindow::setMode(Mode const &mode)

void ClientWindow::closeEvent(QCloseEvent *ev)
{
LOG_DEBUG("Window is about to close, executing 'quit'");
if(!BusyMode_Active())
{
LOG_DEBUG("Window is about to close, executing 'quit'");

/// @todo autosave and quit?
Con_Execute(CMDS_DDAY, "quit", true, false);
/// @todo autosave and quit?
Con_Execute(CMDS_DDAY, "quit", true, false);
}

// We are not authorizing immediate closing of the window;
// engine shutdown will take care of it later.
Expand Down

0 comments on commit abca343

Please sign in to comment.