Skip to content

refactor: drop the storage finalizer - #92

Merged
imurashka merged 1 commit into
mainfrom
ivan/drop-storage-finalizer
Oct 6, 2026
Merged

imurashka merged 1 commit into
mainfrom
ivan/drop-storage-finalizer

Conversation

@imurashka

@imurashka imurashka commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

BinaryStorage holds no unmanaged resources, so its finalizer had nothing to release: it never saved anything, and on the finalizer thread it only released the editor path lock by changing a static set the main thread could be reading at the same time. With the finalizer gone, Dispose(bool) folds back into Dispose().

A storage that is never disposed now keeps its editor path lock until the domain reloads. Nothing changes for storages that are disposed.

@imurashka
imurashka deleted the branch main October 6, 2026 10:43
@imurashka imurashka closed this Oct 6, 2026
@imurashka imurashka reopened this Oct 6, 2026
@imurashka
imurashka changed the base branch from ivan/dedupe-storage-internals to main October 6, 2026 10:43
BinaryStorage holds no unmanaged resources, so the finalizer had nothing to
release. It skipped the save, disposed collections that were already
unreachable, and released the editor path lock by mutating a static HashSet
from the finalizer thread while the main thread could be reading it from
Construct.

With the finalizer gone, disposing is the only path, so Dispose no longer
needs the disposing flag or the two branches it guarded.
@imurashka
imurashka force-pushed the ivan/drop-storage-finalizer branch from ede71b1 to 6a58b63 Compare October 6, 2026 10:44
@imurashka
imurashka merged commit fdec729 into main Oct 6, 2026
2 checks passed
@imurashka
imurashka deleted the ivan/drop-storage-finalizer branch October 6, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant