Skip to content

Commit

Permalink
Add try/catch around nzmqt::poll
Browse files Browse the repository at this point in the history
Qt and exceptions thrown in event handlers... do not mix.
  • Loading branch information
Beirdo committed May 12, 2012
1 parent 051df03 commit 4c2fae0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion mythtv/external/nzmqt/include/nzmqt/nzmqt.hpp
Expand Up @@ -620,7 +620,11 @@ namespace nzmqt
if (m_stopped)
return;

poll();
try {
poll();
} catch (ZMQException e) {
qWarning("Exception during poll: %s\n", e.what());
}

if (!m_stopped)
QTimer::singleShot(m_interval, this, SLOT(run()));
Expand Down
5 changes: 3 additions & 2 deletions mythtv/libs/libmythbase/loggingserver.cpp
Expand Up @@ -1282,9 +1282,10 @@ void LogForwardThread::forwardMessage(LogMessage *msg)
item->deleteItem();
}
}
catch (...)
catch (nzmqt::ZMQException e)
{
cout << "Exception occurred" << endl;
LOG(VB_GENERAL, LOG_ERR, QString("Exception during socket setup: %1")
.arg(e.what()));
}


Expand Down

0 comments on commit 4c2fae0

Please sign in to comment.