//delete will not delete the content,but the variable container,so the content will still survives in memory until all reference are removed and it is collected by the garbage collect.
var foo = bar = new Object();
delete(foo);
trace(bar);//Object object
package ###PACKAGE### {
import com.adobe.cairngorm.model.ModelLocator;
import mx.logging.ILogger;
[Bindable]
public class ###CLASSFILENAME### implements ModelLocator {
private static var model : AppModelLocator;
public function AppLocator() : void {
if ( AppModelLocator.model != null )
throw new Error( "Only one ModelLocator instance should be instantiated" );
}
// singleton: always returns the one existing static instance to itself
public static function getInstance() : AppModelLocator {
if ( model == null )
model = new AppModelLocator();
return model;
}
}
}