Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: hold doc reference in handler #624

Merged
merged 11 commits into from
Jan 17, 2025
Merged

refactor: hold doc reference in handler #624

merged 11 commits into from
Jan 17, 2025

Conversation

Leeeon233
Copy link
Member

Each Container needs to hold a reference to LoroDoc to prevent scenarios like loro-dev/loro-py#7 where LoroDoc might be dropped while the Container's methods are being called.

@Leeeon233 Leeeon233 requested a review from zxch3n January 16, 2025 12:39
Copy link
Member

@zxch3n zxch3n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In loro-wasm/src/lib.rs, we don't need to hold the Arc<LoroDoc> reference in each container then

crates/loro-internal/src/handler.rs Outdated Show resolved Hide resolved
crates/loro-internal/src/delta/map_delta.rs Outdated Show resolved Hide resolved
@Leeeon233 Leeeon233 marked this pull request as draft January 17, 2025 03:29
@Leeeon233 Leeeon233 marked this pull request as ready for review January 17, 2025 13:28
@Leeeon233 Leeeon233 requested a review from zxch3n January 17, 2025 13:29
@Leeeon233 Leeeon233 merged commit 245838f into main Jan 17, 2025
1 check passed
@Leeeon233 Leeeon233 deleted the refactor-doc-arc branch January 17, 2025 15:24
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.

2 participants