61 |
} |
} |
62 |
public void DestroyInstance() |
public void DestroyInstance() |
63 |
{ |
{ |
64 |
xmltv_logger.Log.Debug.WriteLine("Destoying Instance of: '{0}'", this.GetType().Name); |
xmltv_logger.Debug.WriteLine("Destoying Instance of: '{0}'", this.GetType().Name); |
65 |
this.IsAborting = true; |
this.IsAborting = true; |
66 |
if (worker == null) |
if (worker == null) |
67 |
{ |
{ |
68 |
xmltv_logger.Log.Debug.WriteLine("Unable to destroy instance of: '{0}' - worker thread is null", this.GetType().Name); |
xmltv_logger.Debug.WriteLine("Unable to destroy instance of: '{0}' - worker thread is null", this.GetType().Name); |
69 |
return; |
return; |
70 |
} |
} |
71 |
else |
else |
72 |
{ |
{ |
73 |
if (worker.IsAlive) |
if (worker.IsAlive) |
74 |
{ |
{ |
75 |
xmltv_logger.Log.Verbose.Debug.WriteLine("Requesting Instance to Abort..."); |
xmltv_logger.Verbose.Debug.WriteLine("Requesting Instance to Abort..."); |
76 |
while (worker.IsAlive) |
while (worker.IsAlive) |
77 |
{ |
{ |
78 |
worker.Abort(); |
worker.Abort(); |
81 |
} |
} |
82 |
else |
else |
83 |
{ |
{ |
84 |
xmltv_logger.Log.Debug.WriteLine("Instance of: '{0}'- already destroyed.", this.GetType().Name); |
xmltv_logger.Debug.WriteLine("Instance of: '{0}'- already destroyed.", this.GetType().Name); |
85 |
} |
} |
86 |
} |
} |
87 |
} |
} |