Permalink
Browse files

Made Launcher.getInstance() create an instance of needed.

  • Loading branch information...
sk89q committed Oct 18, 2013
1 parent 3635259 commit 7d29593579a7ee1b46a6e62932c0b7e058790f15
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/main/java/com/sk89q/mclauncher/Launcher.java
@@ -96,7 +96,11 @@
*
* @return instance of launcher
*/
- public static Launcher getInstance() {
+ public static synchronized Launcher getInstance() {
+ if (instance == null) {
+ instance = new Launcher();
+ }
+
return instance;
}
@@ -445,7 +449,8 @@ public static void main(String[] args) {
final String password = context.get("password");
final boolean autoLaunch = context.has("launch");
- new Launcher();
+ Launcher.getInstance(); // Load the launcher object
+
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {

0 comments on commit 7d29593

Please sign in to comment.