1
0
Fork 0

(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

release/1.5
rubidium 2014-04-28 21:09:19 +00:00
parent b476086c39
commit 05f7df39ce
1 changed files with 5 additions and 2 deletions

View File

@ -116,15 +116,18 @@ bool DriverFactoryBase::SelectDriverImpl(const char *name, Driver::Type type)
if (d->type != type) continue; if (d->type != type) continue;
if (d->priority != priority) continue; if (d->priority != priority) continue;
Driver *oldd = *GetActiveDriver(type);
Driver *newd = d->CreateInstance(); Driver *newd = d->CreateInstance();
*GetActiveDriver(type) = newd;
const char *err = newd->Start(NULL); const char *err = newd->Start(NULL);
if (err == NULL) { if (err == NULL) {
DEBUG(driver, 1, "Successfully probed %s driver '%s'", GetDriverTypeName(type), d->name); DEBUG(driver, 1, "Successfully probed %s driver '%s'", GetDriverTypeName(type), d->name);
delete *GetActiveDriver(type); delete oldd;
*GetActiveDriver(type) = newd;
return true; return true;
} }
*GetActiveDriver(type) = oldd;
DEBUG(driver, 1, "Probing %s driver '%s' failed with error: %s", GetDriverTypeName(type), d->name, err); DEBUG(driver, 1, "Probing %s driver '%s' failed with error: %s", GetDriverTypeName(type), d->name, err);
delete newd; delete newd;
} }