summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-21 05:35:26 +0000
committerDavid Robillard <d@drobilla.net>2012-12-21 05:35:26 +0000
commitf67344b4c6c7df01dd1e9f3023fa20416103cb6a (patch)
tree4cf79ffe63064255f0951ac35ca2c2b7f4dd7cba /src/World.cpp
parent89703f69e36514584ec5c399f4bdc8fb2cbc4036 (diff)
downloadingen-f67344b4c6c7df01dd1e9f3023fa20416103cb6a.tar.gz
ingen-f67344b4c6c7df01dd1e9f3023fa20416103cb6a.tar.bz2
ingen-f67344b4c6c7df01dd1e9f3023fa20416103cb6a.zip
Fix UI operation via socket.
Fix crashes and deadlocks on shutdown. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4872 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/World.cpp b/src/World.cpp
index a7e3fc02..bcdc4d70 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -149,6 +149,14 @@ public:
interface_factories.clear();
script_runners.clear();
+ // Delete module objects but save pointers to libraries
+ typedef std::list<Glib::Module*> Libs;
+ Libs libs;
+ for (Modules::iterator i = modules.begin(); i != modules.end(); ++i) {
+ libs.push_back(i->second->library);
+ delete i->second;
+ }
+
delete rdf_world;
delete lv2_features;
delete uris;
@@ -157,16 +165,9 @@ public:
lilv_world_free(lilv_world);
-
- for (Modules::iterator i = modules.begin(); i != modules.end(); ++i) {
- // Keep a reference to the library
- Glib::Module* lib = i->second->library;
-
- // Destroy the Ingen module
- delete i->second;
-
- // Now all references to library code should be done, close it
- delete lib;
+ // Close module libraries
+ for (Libs::iterator l = libs.begin(); l != libs.end(); ++l) {
+ delete *l;
}
}