From 0b6b22313e6e4fe3138b40e2fa420fca08b8c868 Mon Sep 17 00:00:00 2001 From: Brandon Amos Date: Fri, 21 Oct 2016 07:47:42 -0400 Subject: [PATCH] Add destructor to torch_neural_net for #194 --- openface/torch_neural_net.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openface/torch_neural_net.py b/openface/torch_neural_net.py index b587206..06239fa 100644 --- a/openface/torch_neural_net.py +++ b/openface/torch_neural_net.py @@ -68,6 +68,10 @@ class TorchNeuralNet: self.p.kill() atexit.register(exitHandler) + def __del__(self): + if self.p.poll() is None: + self.p.kill() + def forwardPath(self, imgPath): """ Perform a forward network pass of an image on disk.