diff --git a/picamera2/allocators/dmaallocator.py b/picamera2/allocators/dmaallocator.py index da672d02..bd73f512 100644 --- a/picamera2/allocators/dmaallocator.py +++ b/picamera2/allocators/dmaallocator.py @@ -95,6 +95,7 @@ def close(self): os.close(fd) self.frame_buffers = {} self.open_fds = [] + self.dmaHeap.close() def __del__(self): self.close() diff --git a/picamera2/dma_heap.py b/picamera2/dma_heap.py index 3b7e1a12..3ee7380e 100644 --- a/picamera2/dma_heap.py +++ b/picamera2/dma_heap.py @@ -107,3 +107,6 @@ def alloc(self, name, size) -> UniqueFD: return UniqueFD() return allocFd + + def close(self): + os.close(self.__dmaHeapHandle.get())