(svn r26099) -Codechange: make NewGRF scanner management slightly easier

This commit is contained in:
rubidium 2013-11-25 09:22:56 +00:00
parent 43edd2409e
commit 2009da4f7d
1 changed files with 3 additions and 4 deletions

View File

@ -638,8 +638,6 @@ int openttd_main(int argc, char *argv[])
} }
break; break;
case 'q': { case 'q': {
delete scanner;
DeterminePaths(argv[0]); DeterminePaths(argv[0]);
if (StrEmpty(mgo.opt)) { if (StrEmpty(mgo.opt)) {
ret = 1; ret = 1;
@ -689,7 +687,6 @@ int openttd_main(int argc, char *argv[])
BaseSounds::FindSets(); BaseSounds::FindSets();
BaseMusic::FindSets(); BaseMusic::FindSets();
ShowHelp(); ShowHelp();
delete scanner;
goto exit_noshutdown; goto exit_noshutdown;
} }
@ -799,7 +796,6 @@ int openttd_main(int argc, char *argv[])
#endif /* ENABLE_NETWORK */ #endif /* ENABLE_NETWORK */
if (!HandleBootstrap()) { if (!HandleBootstrap()) {
delete scanner;
ShutdownGame(); ShutdownGame();
goto exit_bootstrap; goto exit_bootstrap;
@ -867,6 +863,7 @@ int openttd_main(int argc, char *argv[])
/* ScanNewGRFFiles now has control over the scanner. */ /* ScanNewGRFFiles now has control over the scanner. */
ScanNewGRFFiles(scanner); ScanNewGRFFiles(scanner);
scanner = NULL;
_video_driver->MainLoop(); _video_driver->MainLoop();
@ -907,6 +904,8 @@ exit_normal:
free(_ini_videodriver); free(_ini_videodriver);
free(_ini_blitter); free(_ini_blitter);
delete scanner;
#ifdef ENABLE_NETWORK #ifdef ENABLE_NETWORK
extern FILE *_log_fd; extern FILE *_log_fd;
if (_log_fd != NULL) { if (_log_fd != NULL) {