Skip to content

Commit 1063a82

Browse files
author
Andrey Pangin
committed
#70: Do not reuse global arguments between runs
1 parent 8b2fd87 commit 1063a82

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/vmEntry.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,17 @@ extern "C" JNIEXPORT jint JNICALL
137137
Agent_OnAttach(JavaVM* vm, char* options, void* reserved) {
138138
VM::init(vm, true);
139139

140-
Error error = _agent_args.parse(options);
140+
Arguments args;
141+
Error error = args.parse(options);
141142
if (error) {
142143
std::cerr << error.message() << std::endl;
143144
return -1;
144145
}
145146

146-
Profiler::_instance.run(_agent_args);
147+
// Save the arguments in case of shutdown
148+
_agent_args = args;
149+
Profiler::_instance.run(args);
150+
147151
return 0;
148152
}
149153

0 commit comments

Comments
 (0)