summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index ba6989765..98c6503bb 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -638,8 +638,6 @@ int openttd_main(int argc, char *argv[])
}
break;
case 'q': {
- delete scanner;
-
DeterminePaths(argv[0]);
if (StrEmpty(mgo.opt)) {
ret = 1;
@@ -689,7 +687,6 @@ int openttd_main(int argc, char *argv[])
BaseSounds::FindSets();
BaseMusic::FindSets();
ShowHelp();
- delete scanner;
goto exit_noshutdown;
}
@@ -799,7 +796,6 @@ int openttd_main(int argc, char *argv[])
#endif /* ENABLE_NETWORK */
if (!HandleBootstrap()) {
- delete scanner;
ShutdownGame();
goto exit_bootstrap;
@@ -867,6 +863,7 @@ int openttd_main(int argc, char *argv[])
/* ScanNewGRFFiles now has control over the scanner. */
ScanNewGRFFiles(scanner);
+ scanner = NULL;
_video_driver->MainLoop();
@@ -907,6 +904,8 @@ exit_normal:
free(_ini_videodriver);
free(_ini_blitter);
+ delete scanner;
+
#ifdef ENABLE_NETWORK
extern FILE *_log_fd;
if (_log_fd != NULL) {