Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Deallocate finalizer handler when shutting down

We weren't deallocating the finalizer handler. We also don't need
to clean up the process_list_ and live_list_ because they are part of
the list lists too and will be cleaned up there.
  • Loading branch information...
commit 9d26199b9e61fec705748da71af8f982fc02b259 1 parent edddd44
@dbussink dbussink authored
Showing with 5 additions and 3 deletions.
  1. +3 −1 vm/environment.cpp
  2. +2 −0  vm/environment.hpp
  3. +0 −2  vm/gc/finalize.cpp
View
4 vm/environment.cpp
@@ -85,6 +85,7 @@ namespace rubinius {
, signature_(0)
, version_(0)
, signal_handler_(NULL)
+ , finalizer_handler_(NULL)
{
#ifdef ENABLE_LLVM
if(!llvm::llvm_start_multithreaded()) {
@@ -136,6 +137,7 @@ namespace rubinius {
Environment::~Environment() {
delete signal_handler_;
+ delete finalizer_handler_;
VM::discard(state, root_vm);
SharedState::discard(shared);
@@ -352,7 +354,7 @@ namespace rubinius {
}
void Environment::start_finalizer() {
- new FinalizerHandler(state);
+ finalizer_handler_ = new FinalizerHandler(state);
}
void Environment::load_vm_options(int argc, char**argv) {
View
2  vm/environment.hpp
@@ -13,6 +13,7 @@ namespace rubinius {
class ConfigParser;
class QueryAgent;
class SignalHandler;
+ class FinalizerHandler;
/**
* Thrown when unable to find Rubinius runtime directories.
@@ -57,6 +58,7 @@ namespace rubinius {
int version_;
SignalHandler* signal_handler_;
+ FinalizerHandler* finalizer_handler_;
std::string system_prefix_;
View
2  vm/gc/finalize.cpp
@@ -92,8 +92,6 @@ namespace rubinius {
shared_.auxiliary_threads()->unregister_thread(this);
if(iterator_) delete iterator_;
- if(process_list_) delete process_list_;
- if(live_list_) delete live_list_;
for(FinalizeObjectsList::iterator i = lists_->begin(); i != lists_->end(); ++i) {
delete *i;
Please sign in to comment.
Something went wrong with that request. Please try again.