mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 04:00:37 -06:00
Fix crash when unloading layers; Fix issue accidentally unloading an asset too early
This commit is contained in:
committed by
Alexander Bock
parent
8070c307ce
commit
2cf268abf0
@@ -185,7 +185,6 @@ void LayerGroup::deleteLayer(const std::string& layerName) {
|
||||
std::string name = layerName;
|
||||
removePropertySubOwner(it->get());
|
||||
(*it)->deinitialize();
|
||||
_layers.erase(it);
|
||||
properties::PropertyOwner* layerGroup = it->get()->owner();
|
||||
properties::PropertyOwner* layerManager = layerGroup->owner();
|
||||
properties::PropertyOwner* globe = layerManager->owner();
|
||||
@@ -195,6 +194,7 @@ void LayerGroup::deleteLayer(const std::string& layerName) {
|
||||
layerGroup->identifier(),
|
||||
it->get()->identifier()
|
||||
);
|
||||
_layers.erase(it);
|
||||
update();
|
||||
if (_onChangeCallback) {
|
||||
_onChangeCallback(nullptr);
|
||||
|
||||
@@ -127,8 +127,8 @@ void AssetManager::deinitialize() {
|
||||
for (Asset* asset : _rootAssets) {
|
||||
if (!asset->hasInitializedParent()) {
|
||||
asset->deinitialize();
|
||||
asset->unload();
|
||||
}
|
||||
asset->unload();
|
||||
}
|
||||
_toBeDeleted.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user