Skip to content
Browse files

Only try to remove a GC root if it's actually used

These are initialized with cUndef. We already guard the cases for adding
them so we don't add cUndef, so we should also guard this case when
trying to remove it.
  • Loading branch information...
1 parent 6a10774 commit 680dcb520f3ff053e8faa9fee1b33c53d211f182 @dbussink dbussink committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 vm/gc/root.hpp
View
2 vm/gc/root.hpp
@@ -91,7 +91,7 @@ namespace rubinius {
}
~Root() {
- if(roots_ && object_) roots_->remove(this);
+ if(roots_ && object_ && object_ != cUndef) roots_->remove(this);
}
public: /** Methods */

0 comments on commit 680dcb5

Please sign in to comment.
Something went wrong with that request. Please try again.