summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorJohn Anderson <ardour@semiosix.com>2007-12-17 10:45:33 +0000
committerJohn Anderson <ardour@semiosix.com>2007-12-17 10:45:33 +0000
commitc0bb0deb29389590777957be0879f441d2d4a4d6 (patch)
tree7d73aeb381286b8f64ed131d0ce3d43de831c58a /libs/surfaces
parent1a8f9f24df9fcfa44667886c93954c45020333d1 (diff)
slightly better cleanup, and some debug output
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2788 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol_poll.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol_poll.cc b/libs/surfaces/mackie/mackie_control_protocol_poll.cc
index 521b804f93..8b6d332e71 100644
--- a/libs/surfaces/mackie/mackie_control_protocol_poll.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol_poll.cc
@@ -94,15 +94,22 @@ void MackieControlProtocol::update_ports()
if ( _ports_changed )
{
// create new pollfd structures
- if ( pfd != 0 ) delete[] pfd;
+ if ( pfd != 0 )
+ {
+ delete[] pfd;
+ pfd = 0;
+ }
pfd = new pollfd[_ports.size()];
+#ifdef DEBUG
+ cout << "pfd: " << pfd << endl;
+#endif
nfds = 0;
for( MackiePorts::iterator it = _ports.begin(); it != _ports.end(); ++it )
{
// add the port any handler
(*it)->connect_any();
#ifdef DEBUG
- cout << "adding pollfd for port " << (*it)->port().name() << " to pollfd" << endl;
+ cout << "adding pollfd for port " << (*it)->port().name() << " to pollfd " << nfds << endl;
#endif
pfd[nfds].fd = (*it)->port().selectable();
pfd[nfds].events = POLLIN|POLLHUP|POLLERR;