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,12 +104,11 @@ namespace SparkleLib {
public void Dispose () public void Dispose ()
{ {
if (this.thread != null) {
this.thread.Abort (); this.thread.Abort ();
this.thread.Join (); this.thread.Join ();
} }
}
public abstract bool Fetch ();
private void DisableHostKeyCheckingForHost (string host) private void DisableHostKeyCheckingForHost (string host)