1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

web: fix segmention fault during shutdown of web server (closes #93)

This commit is contained in:
Steffen Vogel 2017-06-09 12:02:01 +02:00
parent 38a63f1f82
commit 59f3e86d21

View file

@ -234,15 +234,16 @@ int web_stop(struct web *w)
{
info("Stopping Web sub-system");
if (w->state == STATE_STARTED)
if (w->state == STATE_STARTED) {
lws_cancel_service(w->context);
/** @todo Wait for all connections to be closed */
/** @todo Wait for all connections to be closed */
pthread_cancel(w->thread);
pthread_join(w->thread, NULL);
pthread_cancel(w->thread);
pthread_join(w->thread, NULL);
w->state = STATE_STOPPED;
w->state = STATE_STOPPED;
}
return 0;
}