Skip to content

Commit

Permalink
Merge branch 'release/v20230407'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Apr 7, 2023
2 parents 6397c68 + 8144f0a commit 8aa35fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [20230407]
- Fixes memory leak from PROPVARIANT, refs #72 (@KillerBOSS2019)

## [20230322]
- CI and testing improvements
- Improve audioclient, audiopolicy and mmdeviceapi support, refs #70 (@dot-Eagle96)
Expand Down
5 changes: 4 additions & 1 deletion pycaw/api/mmdeviceapi/depend/structures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ctypes import Structure, Union
from ctypes import Structure, Union, byref, windll
from ctypes.wintypes import DWORD, LONG, LPWSTR, ULARGE_INTEGER, VARIANT_BOOL, WORD

from comtypes import GUID
Expand Down Expand Up @@ -40,6 +40,9 @@ def GetValue(self):
else:
return "%s:?" % (vt)

def clear(self):
windll.ole32.PropVariantClear(byref(self))


class PROPERTYKEY(Structure):
_fields_ = [
Expand Down
3 changes: 1 addition & 2 deletions pycaw/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ def CreateDevice(dev):
"from device %r: %r" % (j, dev, exc)
)
continue
# TODO
# PropVariantClear(byref(value))
value.clear()
name = str(pk)
properties[name] = v
audioState = AudioDeviceState(state)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(fname):
install_requires = ["comtypes", "psutil"]
setup(
name="pycaw",
version="20230322",
version="20230407",
description="Python Core Audio Windows Library",
long_description=read("README.md"),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 8aa35fb

Please sign in to comment.