diff options
Diffstat (limited to 'apps/x11_main.c')
-rw-r--r-- | apps/x11_main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c index d719abda..f0f4f66d 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -554,6 +554,7 @@ int main(int argc, char **argv) fd_set fds; int width = -1; int height = -1; + fz_context *ctx; while ((c = fz_getopt(argc, argv, "p:r:b:A")) != -1) { @@ -583,9 +584,16 @@ int main(int argc, char **argv) if (accelerate) fz_accelerate(); + ctx = fz_context_init(&fz_alloc_default); + if (ctx == NULL) + { + fprintf(stderr, "failed to initialise context"); + exit(1); + } + winopen(); - pdfapp_init(&gapp); + pdfapp_init(ctx, &gapp); gapp.scrw = DisplayWidth(xdpy, xscr); gapp.scrh = DisplayHeight(xdpy, xscr); gapp.resolution = resolution; @@ -742,5 +750,7 @@ int main(int argc, char **argv) XCloseDisplay(xdpy); + fz_context_fin(ctx); + return 0; } |