Browse Source

Better error checking in JackGraphManager::RemoveAllPorts.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2468 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
d1540fe501
3 changed files with 18 additions and 6 deletions
  1. +4
    -0
      ChangeLog
  2. +12
    -4
      common/JackGraphManager.cpp
  3. +2
    -2
      common/JackThread.h

+ 4
- 0
ChangeLog View File

@@ -21,6 +21,10 @@ Romain Moret
Jackdmp changes log Jackdmp changes log
--------------------------- ---------------------------


2008-06-06 Stephane Letz <letz@grame.fr>

* Better error checking in JackGraphManager::RemoveAllPorts.

2008-06-05 Stephane Letz <letz@grame.fr> 2008-06-05 Stephane Letz <letz@grame.fr>


* Better control of exported symbols. * Better control of exported symbols.


+ 12
- 4
common/JackGraphManager.cpp View File

@@ -380,16 +380,24 @@ void JackGraphManager::RemoveAllPorts(int refnum)
JackConnectionManager* manager = WriteNextStateStart(); JackConnectionManager* manager = WriteNextStateStart();
jack_port_id_t port_index; 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); const jack_int_t* input = manager->GetInputPorts(refnum);
while ((port_index = input[0]) != EMPTY) { 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); const jack_int_t* output = manager->GetOutputPorts(refnum);
while ((port_index = output[0]) != EMPTY) { 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(); WriteNextStateStop();


+ 2
- 2
common/JackThread.h View File

@@ -65,6 +65,7 @@ namespace detail


class JackThread class JackThread
{ {

public: public:
enum kThreadState {kIdle, kStarting, kIniting, kRunning}; enum kThreadState {kIdle, kStarting, kIniting, kRunning};
@@ -82,8 +83,7 @@ class JackThread
JackThread(JackRunnableInterface* runnable, int priority, bool real_time, int cancellation): JackThread(JackRunnableInterface* runnable, int priority, bool real_time, int cancellation):
fRunnable(runnable), fPriority(priority), fRealTime(real_time), fStatus(kIdle), fCancellation(cancellation) fRunnable(runnable), fPriority(priority), fRealTime(real_time), fStatus(kIdle), fCancellation(cancellation)
{} {}
kThreadState GetStatus() kThreadState GetStatus()
{ {
return fStatus; return fStatus;


Loading…
Cancel
Save