AssetLibrary removeNamespaceAssets bug?

Software: Away3D 4.x

yesbaba, Newbie
Posted: 13 December 2011 06:49 AM   Total Posts: 13

  public function removeNamespaceAssets(ns : String=null, dispose : Boolean = true) : void
  {
  var idx : uint = 0;
  var asset : IAsset;
  var old_assets : Vector.<IAsset>;
 
  // Empty the assets vector after having stored a copy of it.
  // The copy will be filled with all assets which weren’t removed.
  old_assets = _assets.concat();
  _assets.length = 0;
 
  ns ||= NamedAssetBase.DEFAULT_NAMESPACE;
  for each (asset in _assets) {
  // Remove from dict if in the supplied namespace. If not,
  // transfer over to the new vector.
  if (asset.assetNamespace == ns) {
    if (dispose)
    asset.disposeAsset();
    removeAssetFromDict(asset);
  }
  else {
    _assets[idx++] = asset;
  }
  }
  }

   

yesbaba, Newbie
Posted: 13 December 2011 07:52 AM   Total Posts: 13   [ # 1 ]

this is also wierd

  private function removeAssetFromDict(asset : IAsset) : void
  {
  if (_assetDictDirty)
  rehashAssetDict();
 
  if (_assetDictionary.hasOwnProperty(asset.assetNamespace)) {
  if (_assetDictionary.hasOwnProperty(asset.name))
    delete _assetDictionary[asset.assetNamespace][asset.name];
 
  }
  }

   

Richard Olsson, Administrator
Posted: 13 December 2011 08:17 AM   Total Posts: 1192   [ # 2 ]

Thank you. Please file bugs in the GitHub issue tracker.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X