Trying fix the sigsev on olaThread::socketClosed()
This commit is contained in:
parent
2d16fb6af7
commit
eb447007d9
3 changed files with 10 additions and 11 deletions
|
@ -151,7 +151,7 @@ void AudioLayerWidget::loadMedia(QString file)
|
||||||
std::cout << "File loaded: " << file.toLatin1().constData() << " : " << std::endl;
|
std::cout << "File loaded: " << file.toLatin1().constData() << " : " << std::endl;
|
||||||
std::cout << " " << m_music.getDuration().asSeconds() << " seconds";
|
std::cout << " " << m_music.getDuration().asSeconds() << " seconds";
|
||||||
std::cout << " " << m_music.getSampleRate() << " samples / sec";
|
std::cout << " " << m_music.getSampleRate() << " samples / sec";
|
||||||
std::cout << " " << m_music.getChannelCount() << " channels";
|
std::cout << " " << m_music.getChannelCount() << " channels" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioLayerWidget::fileLoaded(QString file)
|
void AudioLayerWidget::fileLoaded(QString file)
|
||||||
|
|
|
@ -17,14 +17,10 @@ MediaLibrary::MediaLibrary(QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
// ,m_media(new QList<MediaFolder>)
|
// ,m_media(new QList<MediaFolder>)
|
||||||
{
|
{
|
||||||
initMediaLibrary();
|
// initMediaLibrary();
|
||||||
// qDebug("Init MediaLibrary");
|
// qDebug("Init MediaLibrary");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initializes the media library and the media information
|
|
||||||
* from the path to media in m_pathmedia
|
|
||||||
*/
|
|
||||||
|
|
||||||
void MediaLibrary::initMediaLibrary() {
|
void MediaLibrary::initMediaLibrary() {
|
||||||
qDebug("starting the media library");
|
qDebug("starting the media library");
|
||||||
QDir dir;
|
QDir dir;
|
||||||
|
|
|
@ -25,14 +25,17 @@ olaThread::~olaThread() {
|
||||||
|
|
||||||
void olaThread::init()
|
void olaThread::init()
|
||||||
{
|
{
|
||||||
|
m_clientWrapper = new ola::client::OlaClientWrapper;
|
||||||
|
Q_CHECK_PTR(m_clientWrapper);
|
||||||
if (ola::InitLogging(ola::OLA_LOG_INFO , ola::OLA_LOG_STDERR)) {
|
if (ola::InitLogging(ola::OLA_LOG_INFO , ola::OLA_LOG_STDERR)) {
|
||||||
qDebug() << "ola logging debug working";
|
qDebug() << "ola logging debug working";
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Can not init ola logging";
|
qWarning() << "Can not init ola logging";
|
||||||
}
|
}
|
||||||
m_clientWrapper = new ola::client::OlaClientWrapper;
|
if (!m_clientWrapper->Setup()) {
|
||||||
Q_CHECK_PTR(m_clientWrapper);
|
qCritical("olaThread::olaStart| Failed Setup() in Client Wrapper");
|
||||||
if (!m_clientWrapper->Setup()) { qErrnoWarning("olaThread::olaStart| Failed Setup() in Client Wrapper"); }
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
m_client = m_clientWrapper->GetClient();
|
m_client = m_clientWrapper->GetClient();
|
||||||
m_client->SetDMXCallback(ola::NewCallback(this, &olaThread::NewDmx));
|
m_client->SetDMXCallback(ola::NewCallback(this, &olaThread::NewDmx));
|
||||||
m_clientWrapper->GetSelectServer()->RegisterRepeatingTimeout(4000, ola::NewCallback(this, &olaThread::CheckDataLoss));
|
m_clientWrapper->GetSelectServer()->RegisterRepeatingTimeout(4000, ola::NewCallback(this, &olaThread::CheckDataLoss));
|
||||||
|
@ -119,9 +122,9 @@ void olaThread::socketClosed()
|
||||||
qWarning("Can not stop the ola client");
|
qWarning("Can not stop the ola client");
|
||||||
}
|
}
|
||||||
m_clientWrapper->GetSelectServer()->Terminate();
|
m_clientWrapper->GetSelectServer()->Terminate();
|
||||||
delete m_client;
|
// delete m_client;
|
||||||
m_client = NULL;
|
m_client = NULL;
|
||||||
delete m_clientWrapper;
|
// delete m_clientWrapper;
|
||||||
m_clientWrapper = NULL;
|
m_clientWrapper = NULL;
|
||||||
|
|
||||||
// set up ola connection
|
// set up ola connection
|
||||||
|
|
Loading…
Add table
Reference in a new issue