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

Correct race condition in SharedString Drop impl #352

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rbx_types/src/shared_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl Drop for SharedString {
// If the reference we're about to drop is the very last reference to
// the buffer, we'll be able to unwrap it and remove it from the
// SharedString cache.
if Arc::try_unwrap(self.data.take().unwrap()).is_ok() {
if Arc::into_inner(self.data.take().unwrap()).is_some() {
let mut cache = match STRING_CACHE.lock() {
Ok(v) => v,
Err(_) => {
Expand Down