Commit 9e33532
committed
perf: fix potential memory leak for old comment block configurations.
- Added new `commentBlocksDisposables` disposable array to keep track of the comment blocks.
- Changed the variable name for the comment block disposable to `commentBlocksDisposables`.
- Fixed potential memory leak in the `onDidOpenTextDocument` event handler. On each document opening, we reconfigure the comment blocks configs which pushes new disposables everytime. This could lead to memory leaks over time.
Fixed by looping through the `commentBlocksDisposables` array and disposing of each configuration, before new ones are created.1 parent 3cb61c3 commit 9e33532
1 file changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
31 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
89 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| |||
0 commit comments