Un-register the bundle listener, releases resources
765706
@Override
    protected void onStop()
    {
        m_context.removeBundleListener( m_bundleListener );
        final Bundle[] toBeRemoved =
            m_mappings.keySet().toArray( new Bundle[m_mappings.keySet().size()] );
        for( Bundle bundle : toBeRemoved )
        {
            unregister( bundle );
        }

        m_bundleListener = null;
        m_mappings = null;
    }
282225
public void destroy() throws Exception {
        for (Properties properties : propertiesArray) {
            if (properties instanceof ReloadableProperties) {
                logger.debug("remove property listener: " + properties.toString());
                ((ReloadableProperties) properties).removeReloadablePropertiesListener(this);
            }
        }
    }
1329339
public static function unregister()
    {
        self::$registered = false;
        in_array(vfsStream::SCHEME, stream_get_wrappers()) and
            stream_wrapper_unregister(vfsStream::SCHEME);
    }
1017854
void unregisterReceiver() {
        try {
            final Context context = contextRef.get();
            if (context != null) {
                context.unregisterReceiver(receiver);
            }
        } catch (IllegalArgumentException e) {
        }
    }
373757
public void stop(BundleContext context) throws Exception {
        ClassServiceUtility.log(context, LogService.LOG_INFO, "Stopping " + this.getClass().getName() + " Bundle");
    	if (this.shutdownService(service, context))
    		service = null;
        // Unregisters automatically
        this.context = null;
    }
371258
function () {
				delete nucleus.props;
				delete nucleus.needs;
				delete nucleus.providers;
				delete nucleus.listeners;
				while (q.length) {
					q.pop();
				}
				nucleus = props = needs = providers = listeners =
					q = q.pending = q.next = q.args = 0;
			}
271013
function () {
            /*  determine parameters  */
            var params = $cs.params("unlisten", arguments, {
                id: { pos: 0, req: true }
            });

            /*  detach parameters from component  */
            if (typeof this.__listener[params.id] === "undefined")
                throw _cs.exception("unlisten", "listener not found");
            var listener = this.__listener[params.id];
            delete this.__listener[params.id];
            return listener;
        }
893500
def stop_listener(self):
        ''''''
        if self.sock is not None:
            self.sock.close()
            self.sock = None
        self.tracks = {}
31931
function removeListeners() {
			res.removeListener('error',  removeListeners);
			res.removeListener('close',  removeListeners);
			res.removeListener('finish', onResponseFinished);
		}
495795
function unregisterResource( $res_name )
    {
        if ( is_array( $res_name ) )
        {
            foreach ( $res_name as $res )
            {
                $this->unregisterResource( $res );
            }
        }
        else if ( isset( $this->Resources[$res_name] ) )
            unset( $this->Resources[$res_name] );
        else
            $this->warning( "unregisterResource()", "Resource $res_name is not registered, cannot unregister" );
    }
308369
public void removeTangoArchiveListener(ITangoArchiveListener listener)
            throws DevFailed {
        event_listeners.remove(ITangoArchiveListener.class, listener);
        if (event_listeners.size() == 0)
            unsubscribe_event(event_identifier);
    }
406151
@Override
    protected void releaseResources() {
        super.releaseResources();
        PropertySpec.current.remove();
        PropertySpec.currentSpec.remove();
        if (this.state != State.DESTROYED) {
            ParamValueLoaderService.clearParamTree();
            sessionManager = null;
            this.allParams = null;
            this.extraParams = null;
            this.requestParamCache = null;
            this.router = null;
            this.handler = null;
            // xio impl might need this this.request = null;
            // xio impl might need this this.response = null;
            this.flash = null;
            this.session = null;
            this.controllerInstances = null;
            this.result = null;
            this.uploads.clear();
            ActionContext.clearLocal();
        }
        this.state = State.DESTROYED;
    }
554845
public void release() {
        HMSAgentLog.d("release");
        if (application != null) {
            application.unregisterActivityLifecycleCallbacks(this);
        }

        clearCurActivities();
        clearActivitResumeCallbacks();
        clearActivitPauseCallbacks();
        application = null;
    }
190672
private void unregisterListeners() {
    protocol.unregisterExecuteHandler();
    protocol.unregisterBackupHandler();
    protocol.unregisterRestoreHandler();
    protocol.unregisterCloseHandler();
    protocol.unregisterMetadataHandler();
  }
1053824
void destroy() {
        if (onSettled != null) {
            onSettled.run();
        }

        if (pendingReleaseInstances != null) {
            for (PendingReleaseInstance i : pendingReleaseInstances) {
                try {
                    Mvc.graph().dereference(i.instance, i.type, i.qualifier);
                } catch (ProviderMissingException e) {
                    //should not happen
                    //in case this happens just logs it
                    navigationManager.logger.warn("Failed to auto release {} after navigation settled", i.type.getName());
                }
            }
        }
    }
318462
function() {
        // The last component to be unmounted uninstalls the event listener.
        if (components.length == 0) {
            document.removeEventListener(EVENT_TYPE, dispatchEvent);
        }
        components.splice(components.indexOf(this), 1);
    }
1230986
def _unload(self, ):
        
        super(JB_MayaPlugin, self)._unload()
        try:
            if not jukeboxmaya.STANDALONE_INITIALIZED:
                self.uninit_ui()
        except Exception:
            log.exception("Unload Ui failed!")