summaryrefslogtreecommitdiffstats
path: root/src/server/ClientBroadcaster.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-10 03:23:11 +0000
committerDavid Robillard <d@drobilla.net>2012-05-10 03:23:11 +0000
commitda468f24388d7f0f574c6e4dd4022e05d47a9db2 (patch)
tree32e90d5fa55a35caef43cb69592286fc31c5d4f4 /src/server/ClientBroadcaster.cpp
parent281bbcc6a7208c28283bc9bdd521c5d6cc48a60f (diff)
downloadingen-da468f24388d7f0f574c6e4dd4022e05d47a9db2.tar.gz
ingen-da468f24388d7f0f574c6e4dd4022e05d47a9db2.tar.bz2
ingen-da468f24388d7f0f574c6e4dd4022e05d47a9db2.zip
Use SharedPtr references to Interfaces to keep things sane.
Fix double register when using GUI with a remote engine. Avoid signal when writing to dead socket by using send with MSG_NOSIGNAL. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4336 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/ClientBroadcaster.cpp')
-rw-r--r--src/server/ClientBroadcaster.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/ClientBroadcaster.cpp b/src/server/ClientBroadcaster.cpp
index 46e6fb2f..42aad778 100644
--- a/src/server/ClientBroadcaster.cpp
+++ b/src/server/ClientBroadcaster.cpp
@@ -36,7 +36,7 @@ namespace Server {
/** Register a client to receive messages over the notification band.
*/
void
-ClientBroadcaster::register_client(const URI& uri, Interface* client)
+ClientBroadcaster::register_client(const URI& uri, SharedPtr<Interface> client)
{
Glib::Mutex::Lock lock(_clients_mutex);
LOG(info) << "Registered client: " << uri << endl;
@@ -65,7 +65,7 @@ ClientBroadcaster::unregister_client(const URI& uri)
/** Looks up the client with the given source @a uri (which is used as the
* unique identifier for registered clients).
*/
-Interface*
+SharedPtr<Interface>
ClientBroadcaster::client(const URI& uri)
{
Glib::Mutex::Lock lock(_clients_mutex);
@@ -73,7 +73,7 @@ ClientBroadcaster::client(const URI& uri)
if (i != _clients.end()) {
return (*i).second;
} else {
- return NULL;
+ return SharedPtr<Interface>();
}
}
@@ -82,7 +82,7 @@ ClientBroadcaster::send_plugins(const NodeFactory::Plugins& plugins)
{
Glib::Mutex::Lock lock(_clients_mutex);
for (Clients::const_iterator c = _clients.begin(); c != _clients.end(); ++c) {
- send_plugins_to((*c).second, plugins);
+ send_plugins_to((*c).second.get(), plugins);
}
}
@@ -109,7 +109,7 @@ ClientBroadcaster::send_object(const GraphObjectImpl* o, bool recursive)
{
Glib::Mutex::Lock lock(_clients_mutex);
for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) {
- ObjectSender::send_object((*i).second, o, recursive);
+ ObjectSender::send_object((*i).second.get(), o, recursive);
}
}