[banshee] [Banshee.Metadata] Fix race (BGO #598321)
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [Banshee.Metadata] Fix race (BGO #598321)
- Date: Thu, 12 Nov 2009 23:17:44 +0000 (UTC)
commit f145f9f1078ee11d4a0bfc3bb5ee803967217834
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 10779af..499bc30 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]