]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/blobdiff - mt_server.c
free and destroy
[coffee/mt-apps.git] / mt_server.c
index fa099bbd59e90d0f4630f6ad34b6214a2c976532..f7315e13ddcd1ad9e2e916380fe3761053dd6f52 100644 (file)
@@ -81,6 +81,7 @@ void list_deinit(list *in)
     while (in->first) {
         list_remove(in);
     }
+    free(in);
 }
 
 static const struct lws_http_mount mount = {
@@ -292,7 +293,8 @@ int mt_server_init(mt_server_t *self, struct ev_loop *loop, int fd)
 
 void mt_server_deinit(mt_server_t *self)
 {
-    list_deinit((list *)protocols[PROTOCOL_MERICA_TERMINAL].user);
+    free_line(self->fd_watcher.text);
+    list_deinit(self->fd_watcher.lines);
     lws_context_destroy(self->context);
 }
 
@@ -311,6 +313,7 @@ int main(int argc, const char **argv)
     ev_run(loop, 0);
 
     mt_server_deinit(&server);
+    ev_loop_destroy(loop);
 
     return 0;
 }