8000 Memory leak associated with logging when using Python bindings · Issue #686 · Pulse-Eight/libcec · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Memory leak associated with logging when using Python bindings #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JetA2 opened this issue Mar 29, 2025 · 0 comments
Open

Memory leak associated with logging when using Python bindings #686

JetA2 opened this issue Mar 29, 2025 · 0 comments

Comments

@JetA2
Copy link
JetA2 commented Mar 29, 2025

When using Python bindings with libcec in a long-running process, a memory leak can be observed.
The leak seems to have something to do with the logging function, as there is no leak if no log callback is configured.

Using libcec 7.0.0, Python 3.11.2

Minimal code example:

import cec
import time


def libcec_log(level, time, message):
    return 0


libcec_config = cec.libcec_configuration()
libcec_config.bActivateSource = 0
libcec_config.deviceTypes.Add(cec.CEC_DEVICE_TYPE_RECORDING_DEVICE)
libcec_config.clientVersion = cec.LIBCEC_VERSION_CURRENT

# Adding the line below triggers memory leak
libcec_config.SetLogCallback(libcec_log)

lib = cec.ICECAdapter.Create(libcec_config)
adapters = lib.DetectAdapters()
lib.Open(adapters[0].strComName)

while True:
    time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0