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:
Michael Lotz
2008-06-03 06:53:57 +00:00
parent fa827b37fc
commit b4babdf47e
@@ -312,12 +312,11 @@ republish_driver(legacy_driver* driver)
TRACE(("devfs: unpublishing no more present \"%s\"\n", entry->path));
LegacyDevice* device = get_device_for_path(driver, entry->path);
if (device != NULL) {
if (device != NULL)
driver->devices.Remove(device);
delete device;
}
devfs_unpublish_device(entry->path, true);
delete device;
delete entry;
}