diff --git a/ChangeLog b/ChangeLog index 2d95a513..7364301f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,10 @@ Romain Moret Jackdmp changes log --------------------------- +2008-06-06 Stephane Letz + + * Better error checking in JackGraphManager::RemoveAllPorts. + 2008-06-05 Stephane Letz * Better control of exported symbols. diff --git a/common/JackGraphManager.cpp b/common/JackGraphManager.cpp index 3bf069e2..9da2e38a 100644 --- a/common/JackGraphManager.cpp +++ b/common/JackGraphManager.cpp @@ -380,16 +380,24 @@ void JackGraphManager::RemoveAllPorts(int refnum) JackConnectionManager* manager = WriteNextStateStart(); jack_port_id_t port_index; - // Warning : RemovePort shift port to left, thus we always remove the first port until the "input" table is empty + // Warning : ReleasePort shift port to left, thus we always remove the first port until the "input" table is empty const jack_int_t* input = manager->GetInputPorts(refnum); while ((port_index = input[0]) != EMPTY) { - ReleasePort(refnum, port_index); + int res = ReleasePort(refnum, port_index); + if (res < 0) { + jack_error("JackGraphManager::RemoveAllPorts failure ref = %ld port_index = %ld", refnum, port_index); + assert(true); + } } - // Warning : RemovePort shift port to left, thus we always remove the first port until the "output" table is empty + // Warning : ReleasePort shift port to left, thus we always remove the first port until the "output" table is empty const jack_int_t* output = manager->GetOutputPorts(refnum); while ((port_index = output[0]) != EMPTY) { - ReleasePort(refnum, port_index); + int res = ReleasePort(refnum, port_index); + if (res < 0) { + jack_error("JackGraphManager::RemoveAllPorts failure ref = %ld port_index = %ld", refnum, port_index); + assert(true); + } } WriteNextStateStop(); diff --git a/common/JackThread.h b/common/JackThread.h index 0fb5bc5d..42653d87 100644 --- a/common/JackThread.h +++ b/common/JackThread.h @@ -65,6 +65,7 @@ namespace detail class JackThread { + public: enum kThreadState {kIdle, kStarting, kIniting, kRunning}; @@ -82,8 +83,7 @@ class JackThread JackThread(JackRunnableInterface* runnable, int priority, bool real_time, int cancellation): fRunnable(runnable), fPriority(priority), fRealTime(real_time), fStatus(kIdle), fCancellation(cancellation) {} - - + kThreadState GetStatus() { return fStatus;