diff options
-rw-r--r-- | src/server/Engine.cpp | 2 | ||||
-rw-r--r-- | src/server/NodeFactory.cpp | 1 | ||||
-rw-r--r-- | src/socket/Socket.cpp | 8 | ||||
-rw-r--r-- | src/socket/Socket.hpp | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 1a57c112..5c90009f 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -90,11 +90,13 @@ Engine::~Engine() i->second.reset(); delete _maid; + delete _pre_processor; delete _post_processor; delete _node_factory; delete _message_context; delete _control_bindings; delete _broadcaster; + delete _event_writer; munlockall(); } diff --git a/src/server/NodeFactory.cpp b/src/server/NodeFactory.cpp index e64257be..d6e0ab2c 100644 --- a/src/server/NodeFactory.cpp +++ b/src/server/NodeFactory.cpp @@ -128,6 +128,7 @@ NodeFactory::load_plugin(const Raul::URI& uri) ingen_plugin->lilv_plugin(plug); _plugins.insert(make_pair(uri, ingen_plugin)); } + lilv_node_free(node); } /** Loads information about all LV2 plugins into internal plugin database. diff --git a/src/socket/Socket.cpp b/src/socket/Socket.cpp index 97411b64..9192217b 100644 --- a/src/socket/Socket.cpp +++ b/src/socket/Socket.cpp @@ -70,9 +70,16 @@ Socket::Socket(Type t, { } +Socket::~Socket() +{ + free(_addr); + close(); +} + bool Socket::set_addr(const std::string& uri) { + free(_addr); if (_type == UNIX && uri.substr(0, strlen("unix://")) == "unix://") { const std::string path = uri.substr(strlen("unix://")); struct sockaddr_un* uaddr = (struct sockaddr_un*)calloc( @@ -105,6 +112,7 @@ Socket::set_addr(const std::string& uri) _addr = (struct sockaddr*)malloc(ainfo->ai_addrlen); _addr_len = ainfo->ai_addrlen; memcpy(_addr, ainfo->ai_addr, ainfo->ai_addrlen); + freeaddrinfo(ainfo); return true; } return false; diff --git a/src/socket/Socket.hpp b/src/socket/Socket.hpp index 8aa172cb..13f18be8 100644 --- a/src/socket/Socket.hpp +++ b/src/socket/Socket.hpp @@ -55,7 +55,7 @@ public: socklen_t addr_len, int fd); - ~Socket() { close(); } + ~Socket(); /** Bind a server socket to an address. * @param uri Address URI, e.g. unix:///tmp/foo or tcp://somehost:1234 |