From b2289fb65b2da8d88a6e2f91f0d6a3558ea3c6eb Mon Sep 17 00:00:00 2001 From: Konstantinos Vaggelakos Date: Wed, 5 Oct 2011 23:59:22 +0200 Subject: [PATCH] Moved the code to kill the SSH Agent to the SparkleControllerBase instead --- SparkleShare/SparkleControllerBase.cs | 12 +++++------- SparkleShare/Windows/SparkleController.cs | 8 -------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index 476c82b9..f178513c 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -1128,6 +1128,10 @@ namespace SparkleShare { Environment.Exit (0); #else System.Windows.Forms.Application.Exit (); + + // Also kill the SSH_AGENT + int pid = Int32.Parse(System.Environment.GetEnvironmentVariable("SSH_AGENT_PID")); + Process.GetProcessById(pid).Kill(); #endif } @@ -1135,13 +1139,10 @@ namespace SparkleShare { // Checks to see if an email address is valid public bool IsValidEmail (string email) { - Regex regex = new Regex (@"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", RegexOptions.IgnoreCase); + Regex regex = new Regex(@"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", RegexOptions.IgnoreCase); return regex.IsMatch (email); } - - - public void AddNoteToFolder (string folder_name, string revision, string note) { folder_name = folder_name.Replace ("%20", " "); @@ -1153,9 +1154,6 @@ namespace SparkleShare { } } - - - private string [] tango_palette = new string [] {"#eaab00", "#e37222", "#3892ab", "#33c2cb", "#19b271", "#9eab05", "#8599a8", "#9ca696", "#b88454", "#cc0033", "#8f6678", "#8c6cd0", "#796cbf", "#4060af", diff --git a/SparkleShare/Windows/SparkleController.cs b/SparkleShare/Windows/SparkleController.cs index 48b331d8..64eda898 100644 --- a/SparkleShare/Windows/SparkleController.cs +++ b/SparkleShare/Windows/SparkleController.cs @@ -65,8 +65,6 @@ namespace SparkleShare { System.Environment.SetEnvironmentVariable ("HOME", Environment.ExpandEnvironmentVariables ("%HOMEDRIVE%%HOMEPATH%")); StartSshAgent(); - // Start the agent but also make it stop when application is qutting - Application.ApplicationExit += new EventHandler(this.StopSshAgent); base.Initialize (); } @@ -190,12 +188,6 @@ namespace SparkleShare { } } - private void StopSshAgent (object sender, EventArgs e) - { - int pid = Int32.Parse(System.Environment.GetEnvironmentVariable("SSH_AGENT_PID")); - Process.GetProcessById(pid).Kill(); - } - }