Skip to content

Commit

Permalink
Merge pull request #125 from hxcorp/fix/after-attach-dodetach
Browse files Browse the repository at this point in the history
Fix/after attach dodetach
  • Loading branch information
exexute authored Nov 4, 2021
2 parents e9f63b0 + 09c33d6 commit 3f855f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static void attach(String pid, String args) {
vmObj = VirtualMachine.attach(pid);
vmObj.loadAgent(AGENT_PATH, "token=" + args);
LogUtils.info("attach to process " + pid + " success.");
vmObj.detach();
} catch (AttachNotSupportedException e) {
LogUtils.error("attach failed, reason: Attach not support");
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ public synchronized boolean uninstall() {
classOfEngine.getMethod("destroy", String.class, String.class, Instrumentation.class)
.invoke(null, launchMode, this.properties.getPropertiesFilePath(), inst);
Agent.appendToolsPath();
AttachLauncher.detach(ppid);
//no necessary to do detach here
// AttachLauncher.detach(ppid);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
Expand Down

0 comments on commit 3f855f7

Please sign in to comment.