Skip to content

Commit 98e8da7

Browse files
committed
Fix
1 parent ee6f75e commit 98e8da7

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

core/src/com/biglybt/pifimpl/local/utils/resourcedownloader/ResourceDownloaderTorrentImpl.java

+14-21
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
@Override
515515
public void
516516
stateChanged(
517-
final Download download,
517+
Download download,
518518
int old_state,
519519
int new_state )
520520
{
@@ -524,18 +524,11 @@
524524

525525
download.removeListener( this );
526526

527-
PluginInitializer.getDefaultInterface().getUtilities().createThread(
528-
"resource complete event dispatcher",
529-
new Runnable()
530-
{
531-
@Override
532-
public void
533-
run()
534-
{
535-
downloadSucceeded( download, torrent_file, data_dir );
536-
}
537-
});
538-
527+
AEThread2.createAndStartDaemon( "resource complete event dispatcher", ()->{
528+
529+
downloadSucceeded( download, torrent_file, data_dir );
530+
531+
});
539532
}
540533
}
541534

@@ -576,18 +569,18 @@
576569

577570

578571
int state = download.getState();
579-
580-
if ( state == Download.ST_STOPPED ){
581-
582-
// might have been added-stopped, start if so
583-
584-
download.start();
585-
586-
}else if ( state == Download.ST_SEEDING || download.isComplete()){
572+
573+
if ( state == Download.ST_SEEDING || download.isComplete()){
587574

588575
// its possible that the d/l has already occurred and it is seeding!
589576

590577
downloadSucceeded( download, torrent_file, data_dir );
578+
579+
}else if ( state == Download.ST_STOPPED ){
580+
581+
// might have been added-stopped, start if so
582+
583+
download.start();
591584
}
592585
}catch( Throwable e ){
593586

0 commit comments

Comments
 (0)