Move the device deletion after the unpublish call. Fixes crashes where a
device is still referenced through the devfs and used right between deleting and unpublishing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25775 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -312,12 +312,11 @@ republish_driver(legacy_driver* driver)
|
|||||||
|
|
||||||
TRACE(("devfs: unpublishing no more present \"%s\"\n", entry->path));
|
TRACE(("devfs: unpublishing no more present \"%s\"\n", entry->path));
|
||||||
LegacyDevice* device = get_device_for_path(driver, entry->path);
|
LegacyDevice* device = get_device_for_path(driver, entry->path);
|
||||||
if (device != NULL) {
|
if (device != NULL)
|
||||||
driver->devices.Remove(device);
|
driver->devices.Remove(device);
|
||||||
delete device;
|
|
||||||
}
|
|
||||||
|
|
||||||
devfs_unpublish_device(entry->path, true);
|
devfs_unpublish_device(entry->path, true);
|
||||||
|
delete device;
|
||||||
delete entry;
|
delete entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user