Adjusted the code regarding to wimh's comment. Now the SSH_AGENT is killed on application exit
This commit is contained in:
parent
3658bbb3aa
commit
ce2f8b99f5
|
@ -1148,13 +1148,10 @@ namespace SparkleShare {
|
||||||
#else
|
#else
|
||||||
System.Windows.Forms.Application.Exit ();
|
System.Windows.Forms.Application.Exit ();
|
||||||
|
|
||||||
// Also kill the SSH_AGENT
|
// Also kill the SSH_AGENT that we started
|
||||||
try {
|
try {
|
||||||
// Check if we created the process, if so bring it down. Else leave it running
|
|
||||||
if (!System.Environment.GetEnvironmentVariable ("SSH_AUTH_SOCK").Equals ("unknown")) {
|
|
||||||
int pid = Int32.Parse (System.Environment.GetEnvironmentVariable ("SSH_AGENT_PID"));
|
int pid = Int32.Parse (System.Environment.GetEnvironmentVariable ("SSH_AGENT_PID"));
|
||||||
Process.GetProcessById (pid).Kill ();
|
Process.GetProcessById (pid).Kill ();
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Handle exception if needed
|
// Handle exception if needed
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue