---
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/strongloop/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) &gt; [@loopback/context](./context.md) &gt; [Context](./context.context.md) &gt; [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.


