Skip to content

Commit

Permalink
#70: Do not reuse global arguments between runs
Browse files Browse the repository at this point in the history
  • Loading branch information
apangin committed Nov 22, 2017
1 parent 8b2fd87 commit 1063a82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vmEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ extern "C" JNIEXPORT jint JNICALL
Agent_OnAttach(JavaVM* vm, char* options, void* reserved) {
VM::init(vm, true);

Error error = _agent_args.parse(options);
Arguments args;
Error error = args.parse(options);
if (error) {
std::cerr << error.message() << std::endl;
return -1;
}

Profiler::_instance.run(_agent_args);
// Save the arguments in case of shutdown
_agent_args = args;
Profiler::_instance.run(args);

return 0;
}

Expand Down

0 comments on commit 1063a82

Please sign in to comment.