1
Fork 0

rt: Don't run arbitrary destructors on cycle collection; that's just broken.

This commit is contained in:
Patrick Walton 2011-09-26 17:41:22 -07:00
parent 5c973142df
commit a88d9effbc

View file

@ -419,16 +419,9 @@ sweep(rust_task *task, const std::set<void *> &marked) {
while (begin != end) {
void *alloc = begin->first;
if (marked.find(alloc) == marked.end()) {
const type_desc *tydesc = begin->second;
//DPRINT("object is part of a cycle: %p\n", alloc);
// Run the destructor.
// TODO: What if it fails?
if (tydesc->drop_glue) {
tydesc->drop_glue(NULL, task, (void *)tydesc,
tydesc->first_param, alloc);
}
// FIXME: Run the destructor, *if* it's a resource.
task->free(alloc);
}