Load the disk system add-ons in PrepareModifications(). Otherwise the

delegates wouldn't be able to get them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22603 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-10-17 22:25:48 +00:00
parent 27d7c36659
commit a3a0e88e70
1 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,8 @@
#include <syscalls.h>
#include <disk_device_manager/ddm_userland_interface.h>
#include "DiskSystemAddOnManager.h"
/*! \class BDiskDevice
\brief A BDiskDevice object represents a storage device.
@ -226,6 +228,11 @@ BDiskDevice::PrepareModifications()
if (fDelegate)
return B_BAD_VALUE;
// make sure the disk system add-ons are loaded
error = DiskSystemAddOnManager::Default()->LoadDiskSystems();
if (error != B_OK)
return error;
// recursively create the delegates
error = _CreateDelegates();
@ -234,8 +241,10 @@ BDiskDevice::PrepareModifications()
error = _InitDelegates();
// delete all of them, if something went wrong
if (error != B_OK)
if (error != B_OK) {
_DeleteDelegates();
DiskSystemAddOnManager::Default()->UnloadDiskSystems();
}
return error;
}
@ -262,6 +271,7 @@ BDiskDevice::CommitModifications(bool synchronously,
// TODO: Implement!
_DeleteDelegates();
DiskSystemAddOnManager::Default()->UnloadDiskSystems();
if (error == B_OK)
error = _SetTo(ID(), true, false, 0);
@ -286,6 +296,7 @@ BDiskDevice::CancelModifications()
return B_BAD_VALUE;
_DeleteDelegates();
DiskSystemAddOnManager::Default()->UnloadDiskSystems();
if (error == B_OK)
error = _SetTo(ID(), true, false, 0);