From 8129fb1a71a76f123244c9cf914adf37f7c9ccba Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 13 Feb 2008 10:26:21 +0000 Subject: [PATCH] Cleanup git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1853 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackEngine.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index 7a7cb417..c1085c09 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -561,25 +561,20 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai // Remove the client from the table ReleaseRefnum(refnum); - // Remove ports : notiy unregister then remove all ports + // Notiy unregister jack_int_t ports[PORT_NUM_FOR_CLIENT]; fGraphManager->GetInputPorts(refnum, ports); - for (int i = 0; i < PORT_NUM_FOR_CLIENT; i++) { - if (ports[i] != EMPTY) - NotifyPortRegistation(ports[i], false); - else - break; + for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { + NotifyPortRegistation(ports[i], false); } fGraphManager->GetOutputPorts(refnum, ports); - for (int i = 0; i < PORT_NUM_FOR_CLIENT; i++) { - if (ports[i] != EMPTY) - NotifyPortRegistation(ports[i], false); - else - break; + for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { + NotifyPortRegistation(ports[i], false); } + // Remove all ports fGraphManager->RemoveAllPorts(refnum); // Wait until next cycle to be sure client is not used anymore