Commits

Anthony Tuininga committed 49b72cb

Force the service to stop before deleting it.

  • Participants
  • Parent commits e5535f3

Comments (0)

Files changed (1)

source/bases/Win32Service.c

 {
     SC_HANDLE managerHandle, serviceHandle;
     PyObject *fullName, *formatArgs;
+    SERVICE_STATUS statusInfo;
     udt_ServiceInfo info;
 
     // set up Python
             SERVICE_ALL_ACCESS);
     if (!serviceHandle)
         return LogWin32Error(GetLastError(), "cannot open service");
+    ControlService(serviceHandle, SERVICE_CONTROL_STOP, &statusInfo);
     if (!DeleteService(serviceHandle))
         return LogWin32Error(GetLastError(), "cannot delete service");
     CloseServiceHandle(serviceHandle);