From a1a28dc2c25f64d23c6b3637d4eb8aafec910c76 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Mon, 8 Apr 2024 12:14:15 +0200 Subject: [PATCH] disposers.md: Add code formatting to titles --- topics/basics/disposers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/topics/basics/disposers.md b/topics/basics/disposers.md index 0fce67fb9..ad3a2ac1f 100644 --- a/topics/basics/disposers.md +++ b/topics/basics/disposers.md @@ -26,7 +26,7 @@ Project-level services are disposed on project close or plugin unload events. Note that extensions registered in [plugin.xml](plugin_configuration_file.md) are *not* automatically disposed. If an extension requires executing some code to dispose it, you need to define a service and to put the code in its `dispose()` method or use it as a parent disposable. -## The Disposer Singleton +## The `Disposer` Singleton The primary purpose of the [`Disposer`](%gh-ic%/platform/util/src/com/intellij/openapi/util/Disposer.java) singleton is to enforce the rule that _a child `Disposable` never outlives its parent_. The `Disposer` organizes `Disposable` objects in a tree of parent-child relationships. @@ -184,7 +184,7 @@ In such a case, the best strategy is usually to do nothing and return early. A plugin can manually end a `Disposable` lifecycle by calling `Disposer.dispose(Disposable)`. This method handles recursively disposing of all the `Disposable` child descendants as well. -## Implementing the Disposable Interface +## Implementing the `Disposable` Interface Creating a class requires implementing the `Disposable` interface and defining the `dispose()` method. @@ -227,7 +227,7 @@ Regardless, it illustrates the basic pattern, which is: > {style="warning"} -## Diagnosing Disposer Leaks +## Diagnosing `Disposer` Leaks When the application exits, it performs a final sanity check to verify everything was disposed. If something was registered with the `Disposer` but remains undisposed, the IntelliJ Platform reports it before shutting down.