Fixed race condition if patching finishes before the popup is shown
This commit is contained in:
parent
37e84a0d55
commit
24e53c3164
1 changed files with 18 additions and 0 deletions
|
@ -169,6 +169,15 @@ public class ModPatchDialog extends JDialog implements ActionListener, ModPatchO
|
||||||
patchingSucceeded = success;
|
patchingSucceeded = success;
|
||||||
|
|
||||||
continueBtn.setEnabled( true );
|
continueBtn.setEnabled( true );
|
||||||
|
|
||||||
|
if ( !ModPatchDialog.this.isShowing() ) {
|
||||||
|
// The window's not visible, no continueBtn to click.
|
||||||
|
ModPatchDialog.this.dispose();
|
||||||
|
|
||||||
|
if ( patchingSucceeded && successTask != null ) {
|
||||||
|
successTask.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -180,4 +189,13 @@ public class ModPatchDialog extends JDialog implements ActionListener, ModPatchO
|
||||||
public void setSuccessTask( Runnable r ) {
|
public void setSuccessTask( Runnable r ) {
|
||||||
successTask = r;
|
successTask = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows or hides this component depending on the value of parameter b.
|
||||||
|
*
|
||||||
|
* If patching has already completed, this method will do nothing.
|
||||||
|
*/
|
||||||
|
public void setVisible( boolean b ) {
|
||||||
|
if ( !done ) super.setVisible( b );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue