From a62edb3f48133352c085e58c970cd77790d47df2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Apr 2007 03:41:26 +0000 Subject: Fix crash bug on Jack exit. git-svn-id: http://svn.drobilla.net/lad/patchage@434 a436a847-0d15-0410-975c-d299462d15a1 --- src/PatchageEvent.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1