Another fix to gdriver

ugfx_release_2.6
inmarket 2015-08-18 07:39:33 +10:00
parent 8a10ceb80b
commit 2867d6b8f9
1 changed files with 7 additions and 6 deletions

View File

@ -52,13 +52,12 @@ GDriver *gdriverRegister(const GDriverVMT *vmt, void *param) {
return 0;
}
// Add it to the driver chain
if (dhead) {
// Add it to the driver chain (at the end)
if (dhead)
dtail->driverchain = pd;
dtail = pd;
} else {
dhead = dtail = pd;
}
else
dhead = pd;
dtail = pd;
// Do the post init
if (vmt->postinit)
@ -81,6 +80,8 @@ void gdriverUnRegister(GDriver *driver) {
for(pd = dhead; pd->driverchain; pd = pd->driverchain) {
if (pd->driverchain == driver) {
pd->driverchain = driver->driverchain;
if (!pd->driverchain)
dtail = pd;
break;
}
}