From 80e534390888523bb096292b4973d1597abe7506 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 5 Jun 2011 17:35:22 +0100 Subject: [PATCH] fetcher base: check if thread exists before disposing it --- SparkleLib/SparkleFetcherBase.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SparkleLib/SparkleFetcherBase.cs b/SparkleLib/SparkleFetcherBase.cs index 9c5758b7..e348d972 100644 --- a/SparkleLib/SparkleFetcherBase.cs +++ b/SparkleLib/SparkleFetcherBase.cs @@ -40,6 +40,8 @@ namespace SparkleLib { protected string remote_url; private Thread thread; + public abstract bool Fetch (); + public SparkleFetcherBase (string server, string remote_folder, string target_folder) { @@ -102,14 +104,13 @@ namespace SparkleLib { public void Dispose () { - this.thread.Abort (); - this.thread.Join (); + if (this.thread != null) { + this.thread.Abort (); + this.thread.Join (); + } } - public abstract bool Fetch (); - - private void DisableHostKeyCheckingForHost (string host) { string ssh_config_file_path = SparkleHelpers.CombineMore (