core: Copy the plugin list before creating devices
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 30 Jul 2009 00:27:54 +0000 (03:27 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 30 Jul 2009 00:27:54 +0000 (03:27 +0300)
Copy the plugin list before creting devices for each plugin. Otherwise the
mainloop gets run during the device creation and that mostly results in the
modification of the Hashmap holding the plugin list.

src/rygel/rygel-main.vala

index 8de27bb..4cdfbdc 100644 (file)
@@ -107,8 +107,12 @@ public class Rygel.Main : Object {
 
         if (host_ip == null || host_ip == context.host_ip) {
             var factory = new RootDeviceFactory (context);
-
+            var plugins = new ArrayList <Plugin> ();
             foreach (var plugin in this.plugin_loader.list_plugins ()) {
+                plugins.add (plugin);
+            }
+
+            foreach (var plugin in plugins) {
                 this.create_device (plugin, factory);
             }