Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
Delete output_instance after use to prevent memory leak, which can cause a crash on very long jobs.
  • Loading branch information
bwilk7 committed Sep 12, 2014
1 parent d315f7e commit 017b6d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/classifier/Pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,9 @@ void Pipe::Run() {
writer_->Write(output_instance);

if (formatted_instance != instance) delete formatted_instance;
delete output_instance;
delete instance;

instance = reader_->GetNext();
++num_instances;
}
Expand Down

0 comments on commit 017b6d2

Please sign in to comment.