summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/gui/App.cpp11
-rw-r--r--src/libs/gui/App.hpp2
-rw-r--r--src/libs/gui/Port.cpp6
-rw-r--r--src/libs/gui/Port.hpp3
4 files changed, 19 insertions, 3 deletions
diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp
index 54547114..9cf69596 100644
--- a/src/libs/gui/App.cpp
+++ b/src/libs/gui/App.cpp
@@ -234,6 +234,17 @@ App::port_activity(Port* port)
}
+void
+App::activity_port_destroyed(Port* port)
+{
+ ActivityPorts::iterator i = _activity_ports.find(port);
+ if (i != _activity_ports.end())
+ _activity_ports.erase(i);
+
+ return;
+}
+
+
bool
App::animate()
{
diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp
index a693b729..08ceb271 100644
--- a/src/libs/gui/App.hpp
+++ b/src/libs/gui/App.hpp
@@ -98,6 +98,7 @@ public:
void quit();
void port_activity(Port* port);
+ void activity_port_destroyed(Port* port);
bool signal() const { return _enable_signal; }
bool disable_signals() { bool old = _enable_signal; _enable_signal = false; return old; }
@@ -163,7 +164,6 @@ protected:
Ingen::Shared::World* _world;
- /// <Port, whether it has been seen in gtk callback yet>
typedef std::map<Port*, bool> ActivityPorts;
ActivityPorts _activity_ports;
diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp
index f675497b..0452edc6 100644
--- a/src/libs/gui/Port.cpp
+++ b/src/libs/gui/Port.cpp
@@ -73,6 +73,12 @@ Port::Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm
}
+Port::~Port()
+{
+ App::instance().activity_port_destroyed(this);
+}
+
+
void
Port::create_menu()
{
diff --git a/src/libs/gui/Port.hpp b/src/libs/gui/Port.hpp
index ae9b0c48..4851a63f 100644
--- a/src/libs/gui/Port.hpp
+++ b/src/libs/gui/Port.hpp
@@ -39,8 +39,7 @@ class Port : public FlowCanvas::Port
{
public:
Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm, bool flip=false);
-
- virtual ~Port() {}
+ ~Port();
SharedPtr<PortModel> model() const { return _port_model; }