Another fix to gdriver
This commit is contained in:
parent
8a10ceb80b
commit
2867d6b8f9
@ -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;
|
||||
else
|
||||
dhead = pd;
|
||||
dtail = pd;
|
||||
} else {
|
||||
dhead = 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user