lws-vhost-destroy
[platform/upstream/libwebsockets.git] / lwsws / main.c
index f23c24a..0db1cfd 100644 (file)
@@ -199,8 +199,9 @@ reload_handler(int signum)
 
 int main(int argc, char **argv)
 {
-       int n = 0, m, debug_level = 7;
+       int n = 0, debug_level = 7;
 #ifndef _WIN32
+       int m;
        int status, syslog_options = LOG_PID | LOG_PERROR;
 #endif
 
@@ -223,7 +224,7 @@ int main(int argc, char **argv)
                        exit(1);
                }
        }
-
+#ifndef _WIN32
        /*
         * We leave our original process up permanently, because that
         * suits systemd.
@@ -267,7 +268,7 @@ int main(int argc, char **argv)
 // !!! implemenation needed
 #endif
        }
-
+#endif
        /* child process */
 
 #ifndef _WIN32
@@ -302,8 +303,9 @@ int main(int argc, char **argv)
        lws_context_destroy(context);
 
 #if (UV_VERSION_MAJOR > 0) // Travis...
+       lws_close_all_handles_in_loop(&loop);
        n = 0;
-       while (n++ < 1024 && uv_loop_close(&loop))
+       while (n++ < 4096 && uv_loop_close(&loop))
                uv_run(&loop, UV_RUN_NOWAIT);
 #endif
 
@@ -315,5 +317,7 @@ int main(int argc, char **argv)
        closelog();
 #endif
 
+       context = NULL;
+
        return 0;
 }