question: public boolean removeModule ( ModuleHandle moduleHandle ) { boolean noLoadedModules = false ; boolean wasModuleRemoved = false ; synchronized ( privateInstanceLock ) { if ( modules . remove ( moduleHandle ) ) { wasModuleRemoved = true ; noLoadedModules = ( modules . size ( ) == 0 ) ; } } if ( noLoadedModules ) { setTerminated ( true ) ; } return wasModuleRemoved ; }
target:  Removes a module that is no longer loaded in this browser tab. If, after the removal of the module from the list of loaded modules, this browser tab has no loaded modules, it will be marked as terminated, and an event will be reported to all listeners on the model. There should only be a single module loaded in this tab that matches the given module handle. NOTE: This method fires events. If you're invoking this method from other model classes, make sure that no locks are being held.