mirror of
https://github.com/RGBCube/cstree
synced 2025-07-27 09:07:44 +00:00
Bugfix try_write
(#14)
This commit is contained in:
parent
fb463aef18
commit
d67c18cc11
1 changed files with 1 additions and 2 deletions
|
@ -478,12 +478,11 @@ impl<L: Language, D, R> SyntaxNode<L, D, R> {
|
||||||
// overall.
|
// overall.
|
||||||
|
|
||||||
// safety: `node` was just created and has not been shared
|
// safety: `node` was just created and has not been shared
|
||||||
let ref_count = unsafe { Box::from_raw(node.data().ref_count) };
|
let ref_count = unsafe { &*node.data().ref_count };
|
||||||
ref_count.fetch_add(2, Ordering::AcqRel);
|
ref_count.fetch_add(2, Ordering::AcqRel);
|
||||||
let node_data = node.data;
|
let node_data = node.data;
|
||||||
drop(node);
|
drop(node);
|
||||||
unsafe { drop(Box::from_raw(node_data)) };
|
unsafe { drop(Box::from_raw(node_data)) };
|
||||||
drop(ref_count);
|
|
||||||
}
|
}
|
||||||
SyntaxElement::Token(token) => {
|
SyntaxElement::Token(token) => {
|
||||||
// We don't have to worry about `NodeData` or `SyntaxToken<L>`'s own `Drop` here,
|
// We don't have to worry about `NodeData` or `SyntaxToken<L>`'s own `Drop` here,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue