def _finalize(self): if dependency.instance(IHangarSpace).spaceInited: BigWorld.worldDrawEnabled(True) self.__flowLogger.logFinalize(self.__ctx.menuName, self.currentPresenter.currentTab) self.viewModel.onClose -= self.__onCloseClick self.viewModel.onFadeInDone -= self.__onFadeInDone self.viewModel.backButton.onBack -= self.__onBackClicked self.__nyController.onStateChanged -= self.__onStateChanged self.__settingsCore.onSettingsChanged -= self.__onSettingsChanged self.__hangarSpace.setVehicleSelectable(False) g_eventBus.removeListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED, self.__handleSelectedEntityUpdated, scope=EVENT_BUS_SCOPE.DEFAULT) g_eventBus.removeListener(events.NewYearEvent.ON_PRE_SWITCH_VIEW, self.__onPreSwitchViewEvent, scope=EVENT_BUS_SCOPE.LOBBY) g_eventBus.removeListener(events.NewYearEvent.UPDATE_BACK_BUTTON, self.__onBackButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY) self.releaseGiftEventHub() g_eventBus.handleEvent( events.LobbyHeaderMenuEvent( events.LobbyHeaderMenuEvent.TOGGLE_VISIBILITY, ctx={'state': HeaderMenuVisibilityState.ALL}), EVENT_BUS_SCOPE.LOBBY) for presenter in self.__componentPresenters: presenter.finalize() presenter.clear() self.__componentPresenters = [] self.currentPresenter.finalize() self.currentPresenter.clearTabCache() self.currentPresenter.clearNavigationHistory() if self.__regionName: uniprof.exitFromRegion(self.__regionName) for subModelInfo in self.__contentPresentersMap.itervalues(): subModelInfo.presenter.clear() self.__contentPresentersMap.clear() NewYearNavigation.clear() self.__backCallback = None return
def clear(self): g_eventBus.removeListener(LobbySimpleEvent.SWITCH_NEW_YEAR_VIEW, self.__onSwitchEvent, EVENT_BUS_SCOPE.LOBBY) g_eventBus.removeListener(LobbySimpleEvent.SHOW_LOOT_BOX_VIEW, self.__onShowLootBox, EVENT_BUS_SCOPE.LOBBY) NewYearNavigation.clear()