From 77e48a6725ccc30d33596b4f8c3dcdc956b7d1ba Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 9 Oct 2009 02:49:55 -0700 Subject: [PATCH] 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 --- OpenSim/Region/Framework/Scenes/Scene.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ceff28b1ea..6a550fa2a2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1186,10 +1186,10 @@ namespace OpenSim.Region.Framework.Scenes if (!m_backingup) { m_backingup = true; - Thread backupthread = new Thread(Backup); - backupthread.Name = "BackupWriter"; - backupthread.IsBackground = true; - backupthread.Start(); + + System.ComponentModel.BackgroundWorker backupWorker = new System.ComponentModel.BackgroundWorker(); + backupWorker.DoWork += delegate(object sender, System.ComponentModel.DoWorkEventArgs e) { Backup(); }; + backupWorker.RunWorkerAsync(); } }