[banshee/1.5.1-fixes: 35/56] [Banshee.Metadata] Fix race (BGO #598321)
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/1.5.1-fixes: 35/56] [Banshee.Metadata] Fix race (BGO #598321)
- Date: Mon, 22 Mar 2010 18:07:01 +0000 (UTC)
commit 347e040e2eac71850e407cb478dd3527751db519
Author: Gabriel Burt <gabriel burt gmail com>
Date: Thu Nov 12 15:13:28 2009 -0800
[Banshee.Metadata] Fix race (BGO #598321)
.../Banshee.Metadata/SaveTrackMetadataService.cs | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Metadata/SaveTrackMetadataService.cs b/src/Core/Banshee.Services/Banshee.Metadata/SaveTrackMetadataService.cs
index 0ff7f2b..79132e9 100644
--- a/src/Core/Banshee.Services/Banshee.Metadata/SaveTrackMetadataService.cs
+++ b/src/Core/Banshee.Services/Banshee.Metadata/SaveTrackMetadataService.cs
@@ -91,16 +91,15 @@ namespace Banshee.Metadata
if (job != null) {
job.WriteEnabled = WriteEnabled.Value;
job.RenameEnabled = RenameEnabled.Value;
- return;
} else {
- job = new SaveTrackMetadataJob ();
- job.WriteEnabled = WriteEnabled.Value;
- job.RenameEnabled = RenameEnabled.Value;
+ var new_job = new SaveTrackMetadataJob ();
+ new_job.WriteEnabled = WriteEnabled.Value;
+ new_job.RenameEnabled = RenameEnabled.Value;
+ new_job.Finished += delegate { lock (sync) { job = null; } };
+ job = new_job;
+ job.Register ();
}
}
-
- job.Finished += delegate { job = null; };
- job.Register ();
}
private void OnTracksChanged (Source sender, TrackEventArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]