-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Bug Description:
There is a memory leak in Theia caused by inconsistent usage of addEventListener and removeEventListener. A listener is added with the third parameter set to true (capture mode), but later removed without the same flag. This mismatch prevents the listener from being properly removed, causing retained references and increasing memory usage over time. The issue is located in the Theia framework itself, specifically in the file:
@theia/core/lib/browser/browser-menu-plugin.ts
Steps to Reproduce:
Right-click anywhere in the Theia interface to open the context menu.
Close the context menu.
Repeat this process multiple times (open and close the right-click menu).
Observe memory usage increasing over time.
Additional Information
Operating System: Windows 10
Theia Version: 1.60.2 (also reproducible in the latest version)
Affected File: @theia/core/lib/browser/browser-menu-plugin.ts