Skip to content

Commit

Permalink
function_signature should be freed, otherwise 64 bytes of memory is l…
Browse files Browse the repository at this point in the history
…eaked each time the bytecode is constructed
  • Loading branch information
mvdwerve committed Mar 21, 2019
1 parent dbc1fc8 commit 52ca90f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/bytecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ Bytecode::Bytecode(const Source& source) :
jit_exception_set_handler(original_handler);
}

/**
* Destructor
*/
Bytecode::~Bytecode()
{
// if there is a signature, we need to free it
if (_function_signature) jit_type_free(_function_signature);
}

/**
* Method to initialize an error label
* @param label
Expand Down
2 changes: 1 addition & 1 deletion src/bytecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class Bytecode : private Generator, public Executor
/**
* Destructor
*/
virtual ~Bytecode() {};
virtual ~Bytecode();

/**
* Execute the template given a certain handler
Expand Down

0 comments on commit 52ca90f

Please sign in to comment.