diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index b7cc5b8ef..87bb3a28b 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -1101,13 +1101,15 @@ void RemotePluginClient::setShmKey( key_t _key, int _size ) { #ifdef USE_QT_SHMEM m_shmObj.setKey( QString::number( _key ) ); - if( m_shmObj.attach() ) + if( m_shmObj.attach() || m_shmObj.error() == QSharedMemory::NoError ) { m_shm = (float *) m_shmObj.data(); } else { - debugMessage( "failed getting shared memory\n" ); + char buf[64]; + sprintf( buf, "failed getting shared memory: %d\n", m_shmObj.error() ); + debugMessage( buf ); } #else if( m_shm != NULL ) diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index 55fe5309e..dd6a237dd 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -314,7 +314,7 @@ void RemotePlugin::resizeSharedProcessingMemory() #endif } - int shm_key = 0; + static int shm_key = 0; #ifdef USE_QT_SHMEM do {