Don't call the callback after stop() has been called.

This commit is contained in:
akwizgran
2011-10-06 09:25:50 +01:00
parent 6737e4ddfb
commit ffe10e1502

View File

@@ -106,7 +106,7 @@ abstract class FilePlugin implements BatchTransportPlugin {
}
protected void createReaderFromFile(final File f) {
if(!started) throw new IllegalStateException();
if(!started) return;
executor.execute(new ReaderCreator(f));
}
@@ -127,8 +127,12 @@ abstract class FilePlugin implements BatchTransportPlugin {
if(f.length() < TransportConstants.MIN_CONNECTION_LENGTH) return;
try {
FileInputStream in = new FileInputStream(f);
callback.readerCreated(new FileTransportReader(f, in,
FilePlugin.this));
synchronized(FilePlugin.this) {
if(started) {
callback.readerCreated(new FileTransportReader(f, in,
FilePlugin.this));
}
}
} catch(IOException e) {
return;
}