diff options
author | David Robillard <d@drobilla.net> | 2012-05-10 03:23:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-10 03:23:11 +0000 |
commit | da468f24388d7f0f574c6e4dd4022e05d47a9db2 (patch) | |
tree | 32e90d5fa55a35caef43cb69592286fc31c5d4f4 /src/gui/ConnectWindow.cpp | |
parent | 281bbcc6a7208c28283bc9bdd521c5d6cc48a60f (diff) | |
download | ingen-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/gui/ConnectWindow.cpp')
-rw-r--r-- | src/gui/ConnectWindow.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 4d26e61c..b08efb85 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -157,13 +157,19 @@ ConnectWindow::connect(bool existing) uri = user_uri; } - if (existing) + if (existing) { uri = world->engine()->uri().str(); + } - // Create client-side listener - SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024)); + SharedPtr<ThreadedSigClientInterface> tsci; + if (world->engine()) { + tsci = PtrCast<ThreadedSigClientInterface>( + world->engine()->respondee()); + } - world->set_engine(world->interface(uri, tsci)); + if (!tsci) { + world->set_engine(world->interface(uri, tsci)); + } _app->attach(tsci); _app->register_callbacks(); @@ -203,6 +209,7 @@ ConnectWindow::connect(bool existing) SharedPtr<SigClientInterface> client(new SigClientInterface()); + world->engine()->set_respondee(client); _app->attach(client); _app->register_callbacks(); |