@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
32 lines (20 loc) • 939 B
Markdown
lang: en
title: 'API docs: context.context.close'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.context.close.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [close](./context.context.close.md)
## Context.close() method
Close the context: clear observers, stop notifications, and remove event listeners from its parent context.
<b>Signature:</b>
```typescript
close(): void;
```
<b>Returns:</b>
void
## Remarks
This method MUST be called to avoid memory leaks once a context object is no longer needed and should be recycled. An example is the `RequestContext`<!-- -->, which is created per request.