Release/update resources upon destruction.
551292
public void destroy() {
        try {
            if (indexReader != null) {
                indexReader.close();
            }
            
            writer.close();
            indexTracker.save();
        } catch (IOException e) {
            throw MiscUtil.toUnchecked(e);
        }
    }
1163729
def teardown(self):
        '''
        
        '''
        if self.controller:
            self.controller.teardown()
        for monitor in self.monitors:
            monitor.teardown()
1181026
def teardown(self):
        '''
        
        '''
        if not self._torn:
            self._expectations = []
            self._torn = True
            self._teardown()
558849
def _cleanup_resources(self, initialized_resources):
        """"""

        cleanup_errors = []

        # Make sure we clean up all resources that we can and don't error out at the
        # first one.
        for name, res in initialized_resources.items():
            try:
                if res.opened:
                    res.close()
            except Exception:
                _type, value, traceback = sys.exc_info()
                cleanup_errors.append((name, value, traceback))

        if len(cleanup_errors) > 0:
            raise RecipeResourceManagementError(operation="resource cleanup", errors=cleanup_errors)
713893
def teardown(self):
        """"""

        for proxy in self._proxies.values():
            proxy.restore_original_object()

        for patch in self._patches.values():
            patch.restore_original_object()
1067234
function() {
				var runtime = this.getRuntime();
				if (runtime) {
					runtime.exec.call(this, 'FileInput', 'destroy');
					this.disconnectRuntime();
				}

				if (Basic.typeOf(this.files) === 'array') {
					// no sense in leaving associated files behind
					Basic.each(this.files, function(file) {
						file.destroy();
					});
				} 
				this.files = null;
			}
130544
def update_resources(self, data, type_, names=None, languages=None):
        
        UpdateResources(self.filename, data, type_, names, languages)
1311929
def _release_all(self):
        """"""
        for i in self.inputs:
            i.call_release(True)
        self.available_lock.release()
703915
def update_all(self, rs=None, since=None):
        ""
        self._log.info("Updating resources: %s", ' '.join(r.tag for r in rs))

        if rs is None:
            rs = resource.all_resources()
        ctx = self._ContextClass(self)
        for r in rs:
            self._atomic_update(lambda: ctx.sync_resource(r, since=since))
794979
def teardown(self):
        
        self.containers._teardown()
        self.networks._teardown()
        self.volumes._teardown()

        # We need to close the underlying APIClient explicitly to avoid
        # ResourceWarnings from unclosed HTTP connections.
        self._client.api.close()
750942
protected function teardown(): void
    {
        if ($this->worker) {
            @$this->worker->unregisterAll();
            $this->worker = null;
        }
    }
176508
def teardown(self):
        """"""
        self.log.debug('teardown: in')
        self.running = False
        self.shutdown_server()
        shutil.rmtree(self.tmp_diff_folder, ignore_errors=True)
1336472
def remove(self, resource):
        """"""
        if isinstance(resource, Resource):
            self._resources.remove(resource)
54766
def freeze(self, dest_dir):
        """"""
        for resource in self.resources():
            if resource.present:
                resource.freeze(dest_dir)
1129613
public void destroy() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "destroy");
        }

        // Go through the hashtable and destroy all long-lived, single instance,
        // resources related to a given TCP Channel type (NIO, AIO, etc...)
        for (ChannelTermination ct : this.terminationList.values()) {
            ct.terminate();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "destroy");
        }
    }
1293916
public static function cleanup(): void
    {
        $releaseName = sprintf("%s/%s", Utilities::getBasePath(), Utilities::getReleaseName());
        if (is_file($releaseName . '.tar.gz')) {
            unlink($releaseName . '.tar.gz');
        }

        if (is_file($releaseName . '.tar')) {
            unlink($releaseName . '.tar');
        }
    }
571127
def teardown(self):
        
        proc_path = get_proc_path(self.config)
        if os.path.isdir(proc_path):
            shutil.rmtree(proc_path)