summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-11 03:41:26 +0000
committerDavid Robillard <d@drobilla.net>2007-04-11 03:41:26 +0000
commita62edb3f48133352c085e58c970cd77790d47df2 (patch)
treee2ce680be529bdcf5b40b7324b0b48a970706dad /src/PatchageEvent.cpp
parent15b9b7a54e49f75c5933cf3b6388296d0b43a9d0 (diff)
downloadpatchage-a62edb3f48133352c085e58c970cd77790d47df2.tar.gz
patchage-a62edb3f48133352c085e58c970cd77790d47df2.tar.bz2
patchage-a62edb3f48133352c085e58c970cd77790d47df2.zip
Fix crash bug on Jack exit.
git-svn-id: http://svn.drobilla.net/lad/patchage@434 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r--src/PatchageEvent.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp
index b4693b7..7141ac1 100644
--- a/src/PatchageEvent.cpp
+++ b/src/PatchageEvent.cpp
@@ -27,7 +27,13 @@ PatchageEvent::execute()
{
//cerr << "{ EXECUTING EVENT" << endl;
- jack_port_t* const jack_port = jack_port_by_id(_patchage->jack_driver()->client(), _port_id);
+ jack_port_t* jack_port = NULL;
+ if (_patchage->jack_driver()->client())
+ jack_port = jack_port_by_id(_patchage->jack_driver()->client(), _port_id);
+
+ if (!jack_port)
+ return;
+
const string full_name = jack_port_name(jack_port);
const string module_name = full_name.substr(0, full_name.find(":"));
const string port_name = full_name.substr(full_name.find(":")+1);