disposers.md: Clarify enabling disposers debugging

This commit is contained in:
Karol Lewandowski 2024-12-03 11:27:03 +01:00
parent c136a34c96
commit 1645bcb546

View File

@ -232,7 +232,7 @@ Regardless, it illustrates the basic pattern, which is:
When the application exits, it performs a final sanity check to verify everything was disposed. 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. If something was registered with the `Disposer` but remains undisposed, the IntelliJ Platform reports it before shutting down.
In test and Debug mode (`idea.disposer.debug` is set to `on`), registering a `Disposable` with the `Disposer` also registers a stack trace for the object's allocation path. In test, [internal](enabling_internal.md), and debug mode (add `idea.disposer.debug=on` in <ui-path>Help | Edit Custom Properties...</ui-path>), registering a `Disposable` with the `Disposer` also registers a stack trace for the object's allocation path.
The `Disposer` accomplishes this by creating a `Throwable` at the time of registration. The `Disposer` accomplishes this by creating a `Throwable` at the time of registration.
The following snippet represents the sort of "memory leak detected" error encountered in practice: The following snippet represents the sort of "memory leak detected" error encountered in practice: