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 << " " << m_music.getDuration().asSeconds() << " seconds"; | ||||
|     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) | ||||
|  |  | |||
|  | @ -17,14 +17,10 @@ MediaLibrary::MediaLibrary(QObject *parent) : | |||
|     QObject(parent) | ||||
| //  ,m_media(new QList<MediaFolder>)
 | ||||
| { | ||||
|       initMediaLibrary(); | ||||
| //      initMediaLibrary();
 | ||||
| //    qDebug("Init MediaLibrary");
 | ||||
| } | ||||
| 
 | ||||
| /** Initializes the media library and the media information
 | ||||
|  * from the path to media in m_pathmedia | ||||
|  */ | ||||
| 
 | ||||
| void MediaLibrary::initMediaLibrary() { | ||||
|     qDebug("starting the media library"); | ||||
|     QDir dir; | ||||
|  |  | |||
|  | @ -25,14 +25,17 @@ olaThread::~olaThread() { | |||
| 
 | ||||
| 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)) { | ||||
|         qDebug() << "ola logging debug working"; | ||||
|     } else { | ||||
|         qWarning() << "Can not init ola logging"; | ||||
|     } | ||||
|     m_clientWrapper = new ola::client::OlaClientWrapper; | ||||
|     Q_CHECK_PTR(m_clientWrapper); | ||||
|     if (!m_clientWrapper->Setup()) { qErrnoWarning("olaThread::olaStart| Failed Setup() in Client Wrapper"); } | ||||
|     if (!m_clientWrapper->Setup()) { | ||||
|         qCritical("olaThread::olaStart| Failed Setup() in Client Wrapper"); | ||||
|         exit(EXIT_FAILURE); | ||||
|     } | ||||
|     m_client = m_clientWrapper->GetClient(); | ||||
|     m_client->SetDMXCallback(ola::NewCallback(this, &olaThread::NewDmx)); | ||||
|     m_clientWrapper->GetSelectServer()->RegisterRepeatingTimeout(4000, ola::NewCallback(this, &olaThread::CheckDataLoss)); | ||||
|  | @ -119,9 +122,9 @@ void olaThread::socketClosed() | |||
|         qWarning("Can not stop the ola client"); | ||||
|     } | ||||
|     m_clientWrapper->GetSelectServer()->Terminate(); | ||||
|     delete m_client; | ||||
| //    delete m_client;
 | ||||
|     m_client = NULL; | ||||
|     delete m_clientWrapper; | ||||
| //    delete m_clientWrapper;
 | ||||
|     m_clientWrapper = NULL; | ||||
| 
 | ||||
|     // set up ola connection
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue