Skip to content

Commit

Permalink
Merge pull request #46 from msdsoftware/master
Browse files Browse the repository at this point in the history
Revert "Remove unnecessary global static state"
  • Loading branch information
sreilly authored Jun 5, 2019
2 parents 0e09f35 + 227de34 commit 1471089
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions appbundler/native/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ typedef int (JNICALL *JLI_Launch_t)(int argc, char ** argv,
static bool isVerbose = false;
static bool isDebugging = false;

static char** progargv = NULL;
static int progargc = 0;
static int launchCount = 0;

const char * tmpFile();
int launch(char *, int, char **, int launchCount);
int launch(char *, int, char **);

NSString * findJavaDylib (NSString *, bool, bool, bool, bool);
NSString * findJREDylib (int, bool, bool);
Expand All @@ -99,16 +103,12 @@ int main(int argc, char *argv[]) {

int result;
@try {
char** progargv = NULL;
int progargc = 0;
int launchCount = 0;

if ((argc > 1) && (launchCount == 0)) {
progargc = argc - 1;
progargv = &argv[1];
}

launch(argv[0], progargc, progargv, launchCount);
launch(argv[0], progargc, progargv);
result = 0;
} @catch (NSException *exception) {
NSAlert *alert = [[NSAlert alloc] init];
Expand All @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) {
return result;
}

int launch(char *commandName, int progargc, char *progargv[], int launchCount) {
int launch(char *commandName, int progargc, char *progargv[]) {

// check args for `--verbose`
for (int i = 0; i < progargc; i++) {
Expand All @@ -144,7 +144,7 @@ int launch(char *commandName, int progargc, char *progargv[], int launchCount) {
NSDictionary *infoDictionary = [mainBundle infoDictionary];

// Test for debugging (but only on the second runthrough)
bool isDebugging = [[infoDictionary objectForKey:@JVM_DEBUG_KEY] boolValue];
bool isDebugging = (launchCount > 0) && [[infoDictionary objectForKey:@JVM_DEBUG_KEY] boolValue];

Log(@"\n\n\n\nLoading Application '%@'", [infoDictionary objectForKey:@"CFBundleName"]);

Expand Down

0 comments on commit 1471089

Please sign in to comment.