Commit 3d7eff5
fix: keep overlapping sdl.js loads from replacing each other
Removing a <script> tag does not cancel a load in flight, so after an
unmount and remount a stale sdl.js could finish last, overwrite the
shared window.acodePythonSdl, and closing the console would then stop
the wrong SDL instance.
- each load is tagged with a unique data-load-id; sdl.js registers its
API under that id (via document.currentScript) instead of one global
- main.js keeps the API from its own current load for stop/dispose and
ignores loads that finish after a newer one started or after destroy
- destroy bumps the run id so runs waiting for sdl.js never start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 68709cb commit 3d7eff5
3 files changed
Lines changed: 34 additions & 9 deletions
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | | - | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | | - | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
245 | 254 | | |
246 | 255 | | |
| 256 | + | |
| 257 | + | |
247 | 258 | | |
| 259 | + | |
248 | 260 | | |
249 | 261 | | |
250 | | - | |
251 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
252 | 271 | | |
253 | 272 | | |
254 | 273 | | |
| |||
303 | 322 | | |
304 | 323 | | |
305 | 324 | | |
306 | | - | |
307 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
308 | 331 | | |
309 | 332 | | |
310 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | 253 | | |
255 | 254 | | |
256 | | - | |
257 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
0 commit comments