[banshee] PlaybackShuffleActions: Fix crash when setting shuffle mode (bgo#661322)



commit ce9730a68536370a1948a86f5f3fdd77da479b6a
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Wed Dec 21 22:25:51 2011 +0100

    PlaybackShuffleActions: Fix crash when setting shuffle mode (bgo#661322)
    
    Make sure the radio action for the shuffle mode is only updated from the
    main thread. Extensions might change the shuffle mode from another
    thread, which would cause random crashes.

 .../Banshee.Gui/PlaybackShuffleActions.cs          |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs
index 316914a..0487632 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs
@@ -157,12 +157,14 @@ namespace Banshee.Gui
             if (shuffle_modes[active_action.Value] != args.Value) {
                 // This happens only when changing the mode using DBus.
                 // In this case we need to locate the action by its value.
-                foreach (RadioAction action in this) {
-                    if (shuffle_modes[action.Value] == args.Value) {
-                        active_action = action;
-                        break;
+                ThreadAssist.ProxyToMain (delegate {
+                    foreach (RadioAction action in this) {
+                        if (shuffle_modes[action.Value] == args.Value) {
+                            active_action = action;
+                            break;
+                        }
                     }
-                }
+                });
             }
 
             if (saved_action == null) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]