fix service removal.
authorGjergji <gjergjiramku@gmail.com>
Tue, 6 Mar 2018 10:10:41 +0000 (11:10 +0100)
committerGjergji <gjergjiramku@gmail.com>
Tue, 6 Mar 2018 10:10:41 +0000 (11:10 +0100)
Windows service was not removed until tincctl exits

src/tincctl.c

index 99f31b83151d6ca7c93d1032e0cf97e89b2ad824..1ef7941909c397c3c94132985ba3da7acec987f3 100644 (file)
@@ -747,7 +747,10 @@ static bool remove_service(void) {
                fprintf(stderr, "Could not remove %s service: %s\n", identname, winerror(GetLastError()));
                return false;
        }
-
+    if(service)
+        CloseServiceHandle(service);
+    if(manager)
+        CloseServiceHandle(manager);
        fprintf(stderr, "%s service removed\n", identname);
 
        return true;