diff options
author | David Robillard <d@drobilla.net> | 2011-09-23 23:51:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-09-23 23:51:44 +0000 |
commit | 4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e (patch) | |
tree | d2b874fb8e7437cf7ea819fa6faca36e1c3ddc9d /src/server/EngineStore.hpp | |
parent | 41f1be0a68676f33dc1d7dfbb32c5d6440ebd4c9 (diff) | |
download | ingen-4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e.tar.gz ingen-4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e.tar.bz2 ingen-4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e.zip |
Fix memory leaks and errors.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3482 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/EngineStore.hpp')
-rw-r--r-- | src/server/EngineStore.hpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/server/EngineStore.hpp b/src/server/EngineStore.hpp index ba8dd000..76a97b9c 100644 --- a/src/server/EngineStore.hpp +++ b/src/server/EngineStore.hpp @@ -28,10 +28,11 @@ class GraphObject; namespace Server { -class PatchImpl; +class BufferFactory; +class GraphObjectImpl; class NodeImpl; +class PatchImpl; class PortImpl; -class GraphObjectImpl; /** Storage for all GraphObjects (tree of GraphObject's sorted by path). * @@ -45,6 +46,11 @@ class GraphObjectImpl; class EngineStore : public Ingen::Shared::Store { public: + EngineStore(SharedPtr<BufferFactory> f) : _factory(f) {} + ~EngineStore(); + + SharedPtr<BufferFactory> buffer_factory() const { return _factory; } + PatchImpl* find_patch(const Raul::Path& path); NodeImpl* find_node(const Raul::Path& path); PortImpl* find_port(const Raul::Path& path); @@ -57,6 +63,14 @@ public: SharedPtr<Objects> remove(Objects::iterator i); SharedPtr<Objects> remove_children(const Raul::Path& path); SharedPtr<Objects> remove_children(Objects::iterator i); + +private: + /* This holds a reference to the BufferFactory since the objects stored + here refer to it, so the BufferFactory may only be deleted after the + EngineStore is emptied and deleted. + */ + + SharedPtr<BufferFactory> _factory; }; } // namespace Server |