summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-20 16:23:03 +0000
committerDavid Robillard <d@drobilla.net>2007-09-20 16:23:03 +0000
commita4625db3f26716fb7a34614c76582ab92b5212e8 (patch)
tree645f6b35f06a8a7d6cad4a8d59fad9f61346d196 /src/libs/client
parentc4a88de11f5a4c08418523a1f0fd0634b2f56857 (diff)
downloadingen-a4625db3f26716fb7a34614c76582ab92b5212e8.tar.gz
ingen-a4625db3f26716fb7a34614c76582ab92b5212e8.tar.bz2
ingen-a4625db3f26716fb7a34614c76582ab92b5212e8.zip
Fix RDF threading problems (random messy crashes on patch loading).
git-svn-id: http://svn.drobilla.net/lad/ingen@740 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/NodeModel.cpp2
-rw-r--r--src/libs/client/PluginModel.cpp4
-rw-r--r--src/libs/client/PluginModel.hpp9
3 files changed, 15 insertions, 0 deletions
diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp
index c7b38ceb..8c5892e7 100644
--- a/src/libs/client/NodeModel.cpp
+++ b/src/libs/client/NodeModel.cpp
@@ -151,6 +151,8 @@ NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max)
{
assert(port->parent().get() == this);
+ Glib::Mutex::Lock(PluginModel::rdf_world()->mutex());
+
// FIXME: cache these values
// Plugin value first
diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp
index 1e6729d6..10c767ff 100644
--- a/src/libs/client/PluginModel.cpp
+++ b/src/libs/client/PluginModel.cpp
@@ -28,6 +28,8 @@ namespace Client {
SLV2World PluginModel::_slv2_world = NULL;
SLV2Plugins PluginModel::_slv2_plugins = NULL;
#endif
+
+Raul::RDF::World* PluginModel::_rdf_world = NULL;
string
@@ -56,6 +58,8 @@ PluginModel::gui()
{
assert(_type == LV2);
+ Glib::Mutex::Lock(_rdf_world->mutex());
+
SLV2Values gui = slv2_plugin_get_guis(_slv2_plugin);
if (slv2_values_size(gui) > 0) {
printf("\tGUI:\n");
diff --git a/src/libs/client/PluginModel.hpp b/src/libs/client/PluginModel.hpp
index a8d420b8..ba5598c0 100644
--- a/src/libs/client/PluginModel.hpp
+++ b/src/libs/client/PluginModel.hpp
@@ -23,6 +23,7 @@
#include <iostream>
#include <raul/Path.hpp>
#include <raul/SharedPtr.hpp>
+#include <raul/RDFWorld.hpp>
#ifdef HAVE_SLV2
#include <slv2/slv2.h>
#endif
@@ -109,6 +110,12 @@ public:
void* gui();
#endif
+ static void set_rdf_world(Raul::RDF::World& world) {
+ _rdf_world = &world;
+ }
+
+ static Raul::RDF::World* rdf_world() { return _rdf_world; }
+
private:
Type _type;
string _uri;
@@ -120,6 +127,8 @@ private:
SLV2Plugin _slv2_plugin;
#endif
+
+ static Raul::RDF::World* _rdf_world;
};