Skip to content

Commit

Permalink
When using open() make sure there's no handle in use
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Jun 16, 2020
1 parent b73207e commit d75ef03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

N/A

## 1.0.5

**Bugfixes**

- When using `open()` make sure there's no handle in use, if there is, dispose it first. This ensures handle isnt stuck in memory purgatory.

## 1.0.4

**Improvements**
Expand Down
3 changes: 3 additions & 0 deletions pydvdcss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def open(self, psz_target):
open() returns a handle to be used for all subsequent libdvdcss calls. If an
error occurred, NULL is returned.
"""
if self.handle:
# dispose current handle if a dvd is already opened
self.close()
self.handle = self._open(psz_target.encode())
return self.handle

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="pydvdcss",
version="1.0.4-post0",
version="1.0.5",
author="PHOENiX",
author_email="rlaphoenix@pm.me",
description="Python wrapper for VideoLAN's libdvdcss.",
Expand Down

0 comments on commit d75ef03

Please sign in to comment.