Commit 2487662
埃博拉酱
fix: unmount old plugin before loading new version on reload
Call acode.unmountPlugin() before loading the new plugin script in loadPlugin.js.
This ensures the OLD destroy() callback runs while it still exists, properly
cleaning up sidebar apps, commands, event listeners, and filesystem handlers
from the previous plugin instance.
Without this, the new script overwrites the old unmount callback via
acode.setPluginUnmount(), making the old destroy unreachable and causing
resource leaks (duplicate sidebar icons, stale event handlers, etc.).
Also removes the old <script> tag so the browser fetches the new source.1 parent 59df8a0 commit 2487662
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
11 | 29 | | |
12 | 30 | | |
13 | 31 | | |
| |||
0 commit comments