Skip to content

Commit

Permalink
SDL: Revamp pledge() error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bentley committed Jul 10, 2020
1 parent 0387a8e commit 585d55a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/platform/sdl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ int main(int argc, char** argv) {
#ifdef USE_PLEDGE
if (!mPledgeBroad(&args)) {
freeArguments(&args);
fprintf(stderr, "pledge\n");
mCoreConfigDeinit(&renderer.core->config);
mInputMapDeinit(&renderer.core->inputMap);
renderer.core->deinit(renderer.core);
mSDLDeinitEvents(&renderer.events);
mSDLDeinit(&renderer);
fputs("Broad pledge() failed\n", stderr);
return 1;
}
#endif
Expand Down Expand Up @@ -279,10 +284,10 @@ int mSDLRun(struct mSDLRenderer* renderer, struct mArguments* args) {
}
}
#ifdef USE_PLEDGE
if (!mPledgeNarrow(args)) {
didFail = true;
fprintf(stderr, "pledge\n");
}
if (!mPledgeNarrow(args)) {
didFail = true;
fputs("Narrow pledge() failed\n", stderr);
}
#endif
renderer->runloop(renderer, &thread);
mSDLPauseAudio(&renderer->audio);
Expand Down

0 comments on commit 585d55a

Please sign in to comment.