mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -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 )
|
||||
{
|
||||
mRecorders.remove( identifier );
|
||||
recorder.stop();
|
||||
RealBufferWaveRecorder finished = mRecorders.remove( identifier );
|
||||
finished.stop();
|
||||
}
|
||||
}
|
||||
else if( audioPacket.getType() == AudioPacket.Type.AUDIO )
|
||||
|
||||
@@ -125,11 +125,10 @@ public class RealBufferWaveRecorder extends Module
|
||||
|
||||
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
|
||||
@@ -191,7 +190,6 @@ public class RealBufferWaveRecorder extends Module
|
||||
try
|
||||
{
|
||||
mWriter.close();
|
||||
mWriter = null;
|
||||
}
|
||||
catch( IOException io )
|
||||
{
|
||||
@@ -200,11 +198,12 @@ public class RealBufferWaveRecorder extends Module
|
||||
}
|
||||
}
|
||||
|
||||
mFile = null;
|
||||
|
||||
mThreadPoolManager.cancel( mProcessorHandle );
|
||||
|
||||
mWriter = null;
|
||||
mFile = null;
|
||||
mProcessorHandle = null;
|
||||
mThreadPoolManager = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user