summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-25 09:22:56 +0000
committerrubidium <rubidium@openttd.org>2013-11-25 09:22:56 +0000
commit2009da4f7d103b70242063d093517784f656bfd8 (patch)
tree62eb3603f793af0ea259904ec3f0cdc0b3d4aa71
parent43edd2409e62ef90c86c227893e04d1197bc8766 (diff)
downloadopenttd-2009da4f7d103b70242063d093517784f656bfd8.tar.xz
(svn r26099) -Codechange: make NewGRF scanner management slightly easier
-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) {