Skip to content
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

Replaced __del__ with _cleanup to avoid assumptions about object state #120

Merged
merged 1 commit into from
Nov 5, 2016

Conversation

Gadgetoid
Copy link
Collaborator

@Gadgetoid Gadgetoid commented Oct 11, 2016

The existing use of __del__ makes erroneous assumptions about the state of the ws object, which may or may not exist when it's called.

This causes calls to ws_2811_fini and delete_ws2811_t to fail, provoking a landslide of errors and memory leak warnings upon exit.

This fix add a new _cleanup routine that is triggered before objects are deleted, correctly cleaning up the state of ws2811.

Note: I also believe this library should be normalized to indentation of 4 spaces, as is conventional for Python, and not tabs. But that's something for another PR.

@jgarff jgarff merged commit a0c8518 into jgarff:master Nov 5, 2016
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

Successfully merging this pull request may close these issues.

2 participants