X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=main.cpp;h=e953a8cea29d79da4579adb06a3580e989598a28;hp=95142707f572b2cb9d4e8ab7d54d95911d8c9cac;hb=4f4e1384b4299611924a39f59f536b4964806135;hpb=433df75e414444dc9c9f32dbef264531105e47b7 diff --git a/main.cpp b/main.cpp index 9514270..e953a8c 100644 --- a/main.cpp +++ b/main.cpp @@ -248,9 +248,10 @@ int main(int argc, char **argv) static const option long_options[] = { { "state", required_argument, 0, 's' }, { "test-config", no_argument, 0, 't' }, + { 0, 0, 0, 0 } }; int option_index = 0; - int c = getopt_long (argc, argv, "s:t", long_options, &option_index); + int c = getopt_long(argc, argv, "s:t", long_options, &option_index); if (c == -1) { break; @@ -263,7 +264,8 @@ int main(int argc, char **argv) test_config = true; break; default: - assert(false); + fprintf(stderr, "Unknown option '%s'\n", argv[option_index]); + exit(1); } } @@ -406,6 +408,7 @@ start: if (stats_thread != NULL) { stats_thread->stop(); + delete stats_thread; } for (size_t i = 0; i < acceptors.size(); ++i) { acceptors[i]->stop();