RemotePlugin: improved management of shared memory keys

This commit is contained in:
Tobias Doerffel
2012-12-03 00:06:25 +01:00
parent efe3b47810
commit 3bad03d56e
2 changed files with 5 additions and 3 deletions

View File

@@ -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 )

View File

@@ -314,7 +314,7 @@ void RemotePlugin::resizeSharedProcessingMemory()
#endif
}
int shm_key = 0;
static int shm_key = 0;
#ifdef USE_QT_SHMEM
do
{