You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, while I was working on some memory leaks, I find this :
private function removeAssetFromDict(asset : IAsset) : void {
if (_assetDictDirty) rehashAssetDict();
if (_assetDictionary.hasOwnProperty(asset.assetNamespace)) {
if (_assetDictionary.hasOwnProperty(asset.name))
// ------> Should be if ( assetDictionary[asset.assetNamespace].hasOwnProperty(asset.name) )
delete _assetDictionary[asset.assetNamespace][asset.name];
}
}
Cheers, Jeff
The text was updated successfully, but these errors were encountered:
I wasn't sure what you meant, but having looked at the actual code I can see what you are saying. Will fix this.
Note to self: The "Might be" line in the bug report is not currently in the actual removeAssetFromDict() method. This line needs to be amended in AssetLibrary.as:469.
As soon as this bug will be fixed? Because at the moment we have no possibility to remove the asset from the library.
To get rid of it, it is enough to correct only two lines: for each (asset in _assets) { //not correct for each (asset in old_assets) { // correct
and if (_assetDictionary.hasOwnProperty(asset.name)) //not correct if (_assetDictionary [asset.assetNamespace] .hasOwnProperty (asset.name)) // correct
While fixing this, I also implemented some measure to better manage memory when removing assets in the shape of properly deleting namespaces from the internal dictionary when the namespace is empty.
Hi all, while I was working on some memory leaks, I find this :
private function removeAssetFromDict(asset : IAsset) : void {
if (_assetDictDirty) rehashAssetDict();
if (_assetDictionary.hasOwnProperty(asset.assetNamespace)) {
Cheers, Jeff
The text was updated successfully, but these errors were encountered: