summaryrefslogtreecommitdiffstats
path: root/src/libs/module/module.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-31 23:17:02 +0000
committerDavid Robillard <d@drobilla.net>2007-07-31 23:17:02 +0000
commit22395ab7d817dec53e2c2fff07de6d88db70492e (patch)
treee1b4d749e96bfe31f1ba545ad979ca4bbe8807c5 /src/libs/module/module.cpp
parent012890277d8c3124bc8dd1df20b8e016c8d6d811 (diff)
downloadingen-22395ab7d817dec53e2c2fff07de6d88db70492e.tar.gz
ingen-22395ab7d817dec53e2c2fff07de6d88db70492e.tar.bz2
ingen-22395ab7d817dec53e2c2fff07de6d88db70492e.zip
Functional engine Python bindings (e.g. ingen -e -r patchomatic.py).
Rename window nitpick fix from Andrew Greenwood. git-svn-id: http://svn.drobilla.net/lad/ingen@663 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/module/module.cpp')
-rw-r--r--src/libs/module/module.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/libs/module/module.cpp b/src/libs/module/module.cpp
index 68ddc2b5..ab73c09e 100644
--- a/src/libs/module/module.cpp
+++ b/src/libs/module/module.cpp
@@ -15,6 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <iostream>
#include "module.h"
#include "World.hpp"
@@ -23,15 +24,25 @@
#include <slv2/slv2.h>
#endif
+using namespace std;
+
namespace Ingen {
namespace Shared {
-World* world = NULL;
+static World* world = NULL;
World*
get_world()
{
+ static World* world = NULL;
+
+ if (!&world) {
+ cerr << "ERROR: Ingen::Shared::world undefined." << endl;
+ return NULL;
+ }
+
if (!world) {
+ cerr << "NEW WORLD\n" << endl;
world = new World();
world->rdf_world = new Raul::RDF::World();
#ifdef HAVE_SLV2
@@ -46,6 +57,11 @@ get_world()
void
destroy_world()
{
+ if (!&world) {
+ cerr << "ERROR: Ingen::Shared::world undefined." << endl;
+ return;
+ }
+
if (world) {
#ifdef HAVE_SLV2
slv2_world_free(world->slv2_world);