Skip to content

Commit a88d9ef

Browse files
committed
rt: Don't run arbitrary destructors on cycle collection; that's just broken.
1 parent 5c97314 commit a88d9ef

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/rt/rust_cc.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,9 @@ sweep(rust_task *task, const std::set<void *> &marked) {
419419
while (begin != end) {
420420
void *alloc = begin->first;
421421
if (marked.find(alloc) == marked.end()) {
422-
const type_desc *tydesc = begin->second;
423-
424422
//DPRINT("object is part of a cycle: %p\n", alloc);
425423

426-
// Run the destructor.
427-
// TODO: What if it fails?
428-
if (tydesc->drop_glue) {
429-
tydesc->drop_glue(NULL, task, (void *)tydesc,
430-
tydesc->first_param, alloc);
431-
}
424+
// FIXME: Run the destructor, *if* it's a resource.
432425

433426
task->free(alloc);
434427
}

0 commit comments

Comments
 (0)