Volume: Remove all package contents on destruction
This commit is contained in:
parent
77574d40ee
commit
59acdf5045
@ -438,8 +438,8 @@ Volume::~Volume()
|
||||
{
|
||||
_TerminatePackageLoader();
|
||||
|
||||
while (PackageDomain* packageDomain = fPackageDomains.RemoveHead())
|
||||
packageDomain->ReleaseReference();
|
||||
while (PackageDomain* packageDomain = fPackageDomains.Head())
|
||||
_RemovePackageDomain(packageDomain);
|
||||
|
||||
// remove all nodes from the ID hash table
|
||||
Node* node = fNodes.Clear(true);
|
||||
@ -638,6 +638,23 @@ Volume::AddPackageDomain(const char* path)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Volume::_RemovePackageDomain(PackageDomain* domain)
|
||||
{
|
||||
// remove the domain's packages from the node tree
|
||||
VolumeWriteLocker systemVolumeLocker(_SystemVolumeIfNotSelf());
|
||||
VolumeWriteLocker volumeLocker(this);
|
||||
for (PackageFileNameHashTable::Iterator it
|
||||
= domain->Packages().GetIterator(); Package* package = it.Next();) {
|
||||
_RemovePackageContent(package, NULL, false);
|
||||
}
|
||||
|
||||
// remove the domain
|
||||
fPackageDomains.Remove(domain);
|
||||
domain->ReleaseReference();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Volume::PackageLinkDirectoryAdded(PackageLinkDirectory* directory)
|
||||
{
|
||||
|
@ -107,6 +107,7 @@ private:
|
||||
status_t _AddInitialPackageDomain(const char* path);
|
||||
status_t _AddPackageDomain(PackageDomain* domain,
|
||||
bool notify);
|
||||
void _RemovePackageDomain(PackageDomain* domain);
|
||||
status_t _LoadPackage(Package* package);
|
||||
|
||||
status_t _AddPackageContent(Package* package,
|
||||
|
Loading…
Reference in New Issue
Block a user