aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-09-04 01:25:07 +0200
committerdec05eba <dec05eba@protonmail.com>2022-09-04 01:25:07 +0200
commit84f501f5211f09a09fc5384bf15415d0d0445a96 (patch)
tree21e2364ead11363270f1bc0e54dbe61ebda1c7c7
parentdc096b888bf7cb1edaad2146ebe0588bc65ba78a (diff)
Do not segfault when the program is closed before the window is created
m---------depends/mglpp0
-rw-r--r--src/QuickMedia.cpp6
2 files changed, 5 insertions, 1 deletions
diff --git a/depends/mglpp b/depends/mglpp
-Subproject 550119dcfca055a0a09435ee71926d86bab455c
+Subproject 64f9697f09fe806415ce5c8c5074ce022fefd0a
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index f6fe726..7a18f47 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -369,6 +369,8 @@ namespace QuickMedia {
}
int Program::run(int argc, char **argv) {
+ mgl_init();
+
if(argc < 1) {
usage();
return -1;
@@ -465,6 +467,9 @@ namespace QuickMedia {
usage();
return -1;
}
+ } else if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
+ usage();
+ return 0;
} else if(argv[i][0] == '-') {
fprintf(stderr, "Invalid option %s\n", argv[i]);
usage();
@@ -544,7 +549,6 @@ namespace QuickMedia {
};
no_video = force_no_video;
- mgl_init();
init(parent_window, program_path);
if(strcmp(plugin_name, "download") == 0) {