You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(editor): dispose font and overlay managers (tldraw#8896)
In order to clean up editor manager state across editor lifecycles, this
PR adds disposal hooks for the FontManager and overlay manager
lifecycle. It clears FontManager font state and pending font requests,
releases its store-backed cache references, and disposes registered
overlay utils from editor disposal. Closestldraw#8885. Closestldraw#8891.
### Change type
- [x] `api`
### Test plan
1. `cd packages/editor && yarn test run
src/lib/editor/managers/FontManager/FontManager.test.ts`
2. `cd packages/tldraw && yarn test run
src/test/overlays/OverlayManager.test.ts`
3. `yarn typecheck`
4. `yarn api-check`
5. `yarn lint-current`
- [x] Unit tests
### Release notes
- Add disposal lifecycle hooks for font and overlay managers.
### API changes
- Added `FontManager.dispose()` for clearing font manager state and
cache references.
- Added `OverlayManager.dispose()` for disposing registered overlay
utils.
- Added `OverlayUtil.dispose()` as a default no-op for custom overlay
cleanup.
### Code changes
| Section | LOC change |
| --------------- | ---------- |
| Core code | +33 / -2 |
| Tests | +71 / -2 |
| Automated files | +5 / -0 |
0 commit comments