Skip to content

Commit

Permalink
Close process in tools functions only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaggioni committed Nov 7, 2024
1 parent 410a24f commit 6724c40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions haffmpeg/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ async def get_image(
return None

finally:
await self.close(0)
if self.is_running:
await self.close(0)


class FFVersion(HAFFmpeg):
Expand Down Expand Up @@ -87,6 +88,7 @@ async def get_version(self, timeout: int = 15) -> Optional[str]:
self.kill()

finally:
await self.close(0)
if self.is_running:
await self.close(0)

return None

0 comments on commit 6724c40

Please sign in to comment.