Skip to content

Commit d75ef03

Browse files
committed
When using open() make sure there's no handle in use
1 parent b73207e commit d75ef03

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

HISTORY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
N/A
66

7+
## 1.0.5
8+
9+
**Bugfixes**
10+
11+
- 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.
12+
713
## 1.0.4
814

915
**Improvements**

pydvdcss/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ def open(self, psz_target):
141141
open() returns a handle to be used for all subsequent libdvdcss calls. If an
142142
error occurred, NULL is returned.
143143
"""
144+
if self.handle:
145+
# dispose current handle if a dvd is already opened
146+
self.close()
144147
self.handle = self._open(psz_target.encode())
145148
return self.handle
146149

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="pydvdcss",
8-
version="1.0.4-post0",
8+
version="1.0.5",
99
author="PHOENiX",
1010
author_email="rlaphoenix@pm.me",
1111
description="Python wrapper for VideoLAN's libdvdcss.",

0 commit comments

Comments
 (0)