Camera feed is also stopped when NetworkCamera is destroyed

CL-541
This commit is contained in:
Jaime van Kessel 2017-12-20 15:39:52 +01:00
parent 95b1e8f68c
commit 23330cd086

View file

@ -87,6 +87,10 @@ class NetworkCamera(QObject):
def getImage(self): def getImage(self):
return self._image return self._image
## Ensure that close gets called when object is destroyed
def __del__(self):
self.close()
def _onStreamDownloadProgress(self, bytes_received, bytes_total): def _onStreamDownloadProgress(self, bytes_received, bytes_total):
# An MJPG stream is (for our purpose) a stream of concatenated JPG images. # An MJPG stream is (for our purpose) a stream of concatenated JPG images.
# JPG images start with the marker 0xFFD8, and end with 0xFFD9 # JPG images start with the marker 0xFFD8, and end with 0xFFD9