summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/gui/RenameWindow.cpp3
-rw-r--r--src/libs/module/Module.cpp5
-rw-r--r--src/libs/module/module.cpp18
-rw-r--r--src/libs/module/module.h9
4 files changed, 23 insertions, 12 deletions
diff --git a/src/libs/gui/RenameWindow.cpp b/src/libs/gui/RenameWindow.cpp
index 6567799e..d5ef1b24 100644
--- a/src/libs/gui/RenameWindow.cpp
+++ b/src/libs/gui/RenameWindow.cpp
@@ -74,7 +74,8 @@ RenameWindow::name_changed()
} else if (!Path::is_valid_name(name)) {
_message_label->set_text("Name contains invalid characters");
_ok_button->property_sensitive() = false;
- } else if (App::instance().store()->object(_object->parent()->path().base() + name)) {
+ } else if ((App::instance().store()->object(_object->parent()->path().base() + name)) &&
+ (name != _object->path().name())) {
_message_label->set_text("An object already exists with that name.");
_ok_button->property_sensitive() = false;
} else if (name.length() == 0) {
diff --git a/src/libs/module/Module.cpp b/src/libs/module/Module.cpp
index 9aacd0cc..e5a137e7 100644
--- a/src/libs/module/Module.cpp
+++ b/src/libs/module/Module.cpp
@@ -56,7 +56,7 @@ load_module(const string& name)
string filename = Glib::Module::build_path(dir, name);
if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
- module = new Glib::Module(filename, Glib::MODULE_BIND_LAZY);
+ module = new Glib::Module(filename);
if (*module) {
return SharedPtr<Glib::Module>(module);
@@ -70,8 +70,7 @@ load_module(const string& name)
// Try default directory if not found
module = new Glib::Module(
- Glib::Module::build_path(INGEN_MODULE_DIR, name),
- Glib::MODULE_BIND_LAZY);
+ Glib::Module::build_path(INGEN_MODULE_DIR, name));
if (*module) {
return SharedPtr<Glib::Module>(module);
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);
diff --git a/src/libs/module/module.h b/src/libs/module/module.h
index 48bdeedf..4fe0d4cc 100644
--- a/src/libs/module/module.h
+++ b/src/libs/module/module.h
@@ -25,13 +25,8 @@
namespace Ingen {
namespace Shared {
-extern "C" {
-
- World* get_world();
- void destroy_world();
-
-}
-
+World* get_world();
+void destroy_world();
} // namesace Shared
} // namespace Ingen