Change the backup thread to run on a BackgroundWorker instead of a Thread. I don't have an explanation, but this seems to stop a slow but steady memory leak I was experiencing

prioritization
John Hurliman 2009-10-09 02:49:55 -07:00
parent 76a5cae0b4
commit 77e48a6725
1 changed files with 4 additions and 4 deletions

View File

@ -1186,10 +1186,10 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_backingup) if (!m_backingup)
{ {
m_backingup = true; m_backingup = true;
Thread backupthread = new Thread(Backup);
backupthread.Name = "BackupWriter"; System.ComponentModel.BackgroundWorker backupWorker = new System.ComponentModel.BackgroundWorker();
backupthread.IsBackground = true; backupWorker.DoWork += delegate(object sender, System.ComponentModel.DoWorkEventArgs e) { Backup(); };
backupthread.Start(); backupWorker.RunWorkerAsync();
} }
} }