Skip to content

Commit 2c6b3d0

Browse files
Add test for #172
1 parent f9f3d3b commit 2c6b3d0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

itest/rust/src/object_test.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,16 @@ fn object_engine_manual_free() {
531531
} // drop(node)
532532
}
533533

534+
/// Tests the [`DynamicRefCount`] destructor when the underlying [`Object`] is already freed.
535+
#[itest]
536+
fn object_engine_shared_free() {
537+
{
538+
let node = Node::new_alloc();
539+
let _object = node.share().upcast::<Object>();
540+
node.free();
541+
} // drop(_object)
542+
}
543+
534544
#[itest]
535545
fn object_engine_manual_double_free() {
536546
expect_panic("double free()", || {

0 commit comments

Comments
 (0)