base_process_service: properly clean up in destructor.
authorDavin McCall <davmac@davmac.org>
Sat, 10 Feb 2018 16:53:09 +0000 (16:53 +0000)
committerDavin McCall <davmac@davmac.org>
Sat, 10 Feb 2018 16:53:09 +0000 (16:53 +0000)
src/includes/proc-service.h

index 606c5b15e28d809cd8373c7b544403018590b7ff..2a46f02ac5f0f1e0e91b622c7cb8669b16edf1a6 100644 (file)
@@ -137,6 +137,10 @@ class base_process_service : public service_record
 
     ~base_process_service() noexcept
     {
+        if (reserved_child_watch) {
+            child_listener.unreserve(event_loop);
+        }
+        restart_timer.deregister(event_loop);
     }
 
     // Set the stop command and arguments (may throw std::bad_alloc)