Skip to content

Commit f732ad5

Browse files
committed
objManager is not static
1 parent a57d428 commit f732ad5

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

  • daemon/src/main/java/org/lsposed/lspd/cli

daemon/src/main/java/org/lsposed/lspd/cli/Main.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,6 @@ public class Main implements Runnable {
677677
@CommandLine.Spec
678678
CommandLine.Model.CommandSpec spec;
679679

680-
private static ICLIService objManager;
681-
682680
public Main() {
683681
}
684682

@@ -713,17 +711,16 @@ public int handleExecutionException(Exception ex, CommandLine commandLine, Parse
713711
}
714712

715713
public final ICLIService getManager() {
716-
if (objManager == null) {
717-
try {
718-
objManager = connectToService();
719-
if (objManager == null) {
720-
// connectToService will throw, but as a fallback:
721-
throw new SecurityException("Authentication failed or daemon service not available.");
722-
}
723-
} catch (RemoteException | SecurityException e) {
724-
System.err.println("Error: " + e.getMessage());
725-
System.exit(ERRCODES.NO_DAEMON.ordinal());
714+
ICLIService objManager;
715+
try {
716+
objManager = connectToService();
717+
if (objManager == null) {
718+
// connectToService will throw, but as a fallback:
719+
throw new SecurityException("Authentication failed or daemon service not available.");
726720
}
721+
} catch (RemoteException | SecurityException e) {
722+
System.err.println("Error: " + e.getMessage());
723+
System.exit(ERRCODES.NO_DAEMON.ordinal());
727724
}
728725
return objManager;
729726
}

0 commit comments

Comments
 (0)