mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 10:37:26 -05:00
Resolved issue with wave recorders not shutting down correctly, causing
errors with max file handles is exceeded.
This commit is contained in:
@@ -72,8 +72,8 @@ public class RecorderManager implements Listener<AudioPacket>
|
|||||||
}
|
}
|
||||||
else if( audioPacket.getType() == AudioPacket.Type.END )
|
else if( audioPacket.getType() == AudioPacket.Type.END )
|
||||||
{
|
{
|
||||||
mRecorders.remove( identifier );
|
RealBufferWaveRecorder finished = mRecorders.remove( identifier );
|
||||||
recorder.stop();
|
finished.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( audioPacket.getType() == AudioPacket.Type.AUDIO )
|
else if( audioPacket.getType() == AudioPacket.Type.AUDIO )
|
||||||
|
|||||||
@@ -125,11 +125,10 @@ public class RealBufferWaveRecorder extends Module
|
|||||||
|
|
||||||
public void stop()
|
public void stop()
|
||||||
{
|
{
|
||||||
if( mRunning.compareAndSet( true, false ) )
|
/* Signal the buffer processor to end with a poison pill */
|
||||||
{
|
receive( new PoisonPill() );
|
||||||
/* Signal the buffer processor to end with a poison pill */
|
|
||||||
receive( new PoisonPill() );
|
mRunning.set( false );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -191,7 +190,6 @@ public class RealBufferWaveRecorder extends Module
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
mWriter.close();
|
mWriter.close();
|
||||||
mWriter = null;
|
|
||||||
}
|
}
|
||||||
catch( IOException io )
|
catch( IOException io )
|
||||||
{
|
{
|
||||||
@@ -200,11 +198,12 @@ public class RealBufferWaveRecorder extends Module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mFile = null;
|
|
||||||
|
|
||||||
mThreadPoolManager.cancel( mProcessorHandle );
|
mThreadPoolManager.cancel( mProcessorHandle );
|
||||||
|
|
||||||
|
mWriter = null;
|
||||||
|
mFile = null;
|
||||||
mProcessorHandle = null;
|
mProcessorHandle = null;
|
||||||
|
mThreadPoolManager = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user