コード例 #1
0
        /// <summary>
        /// Verwendete Ressourcen bereinigen.
        /// </summary>
        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
        protected override void Dispose(bool disposing)
        {
            SaveThreadRunning = false;
            SavingEnabled     = false;

            if (SaveThread != null)
            {
                try
                {
                    lock (SaveBufferTrigger)
                    {
                        Monitor.Pulse(SaveBufferTrigger);
                    }
                    //SaveBufferTrigger.Release(1);
                    if (!SaveThread.Join(300))
                    {
                        SaveThread.Abort();
                    }
                }
                catch (Exception e)
                {
                }
                SaveThread = null;
            }

            if (disposing && (components != null))
            {
                components.Dispose();
            }

            base.Dispose(disposing);
        }
コード例 #2
0
 void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         SaveThread.Abort();
         downloadThread.Abort();
     } catch (Exception)
     {
     }
 }