Changeset - r21437:79dee43b34d5
[Not reviewed]
master
0 1 0
rubidium - 10 years ago 2014-04-28 21:09:19
rubidium@openttd.org
(svn r26539) -Fix [FS#5994]: [Windows] Crash due to assuming (formerly) _video_driver is being set before the operating system has time to perform the first "paint" callback
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/driver.cpp
Show inline comments
 
@@ -116,15 +116,18 @@ bool DriverFactoryBase::SelectDriverImpl
 
				if (d->type != type) continue;
 
				if (d->priority != priority) continue;
 

	
 
				Driver *oldd = *GetActiveDriver(type);
 
				Driver *newd = d->CreateInstance();
 
				*GetActiveDriver(type) = newd;
 

	
 
				const char *err = newd->Start(NULL);
 
				if (err == NULL) {
 
					DEBUG(driver, 1, "Successfully probed %s driver '%s'", GetDriverTypeName(type), d->name);
 
					delete *GetActiveDriver(type);
 
					*GetActiveDriver(type) = newd;
 
					delete oldd;
 
					return true;
 
				}
 

	
 
				*GetActiveDriver(type) = oldd;
 
				DEBUG(driver, 1, "Probing %s driver '%s' failed with error: %s", GetDriverTypeName(type), d->name, err);
 
				delete newd;
 
			}
0 comments (0 inline, 0 general)