fetcher base: check if thread exists before disposing it

This commit is contained in:
Hylke Bons 2011-06-05 17:35:22 +01:00
parent 91bd2bff63
commit 80e5343908

View file

@ -40,6 +40,8 @@ namespace SparkleLib {
protected string remote_url; protected string remote_url;
private Thread thread; private Thread thread;
public abstract bool Fetch ();
public SparkleFetcherBase (string server, string remote_folder, string target_folder) public SparkleFetcherBase (string server, string remote_folder, string target_folder)
{ {
@ -102,14 +104,13 @@ namespace SparkleLib {
public void Dispose () public void Dispose ()
{ {
this.thread.Abort (); if (this.thread != null) {
this.thread.Join (); this.thread.Abort ();
this.thread.Join ();
}
} }
public abstract bool Fetch ();
private void DisableHostKeyCheckingForHost (string host) private void DisableHostKeyCheckingForHost (string host)
{ {
string ssh_config_file_path = SparkleHelpers.CombineMore ( string ssh_config_file_path = SparkleHelpers.CombineMore (