Volume: Remove all package contents on destruction
This commit is contained in:
@@ -438,8 +438,8 @@ Volume::~Volume()
|
|||||||
{
|
{
|
||||||
_TerminatePackageLoader();
|
_TerminatePackageLoader();
|
||||||
|
|
||||||
while (PackageDomain* packageDomain = fPackageDomains.RemoveHead())
|
while (PackageDomain* packageDomain = fPackageDomains.Head())
|
||||||
packageDomain->ReleaseReference();
|
_RemovePackageDomain(packageDomain);
|
||||||
|
|
||||||
// remove all nodes from the ID hash table
|
// remove all nodes from the ID hash table
|
||||||
Node* node = fNodes.Clear(true);
|
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
|
void
|
||||||
Volume::PackageLinkDirectoryAdded(PackageLinkDirectory* directory)
|
Volume::PackageLinkDirectoryAdded(PackageLinkDirectory* directory)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ private:
|
|||||||
status_t _AddInitialPackageDomain(const char* path);
|
status_t _AddInitialPackageDomain(const char* path);
|
||||||
status_t _AddPackageDomain(PackageDomain* domain,
|
status_t _AddPackageDomain(PackageDomain* domain,
|
||||||
bool notify);
|
bool notify);
|
||||||
|
void _RemovePackageDomain(PackageDomain* domain);
|
||||||
status_t _LoadPackage(Package* package);
|
status_t _LoadPackage(Package* package);
|
||||||
|
|
||||||
status_t _AddPackageContent(Package* package,
|
status_t _AddPackageContent(Package* package,
|
||||||
|
|||||||
Reference in New Issue
Block a user