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

PR: Close memory leak #990

Merged
merged 1 commit into from
Sep 13, 2022
Merged

PR: Close memory leak #990

merged 1 commit into from
Sep 13, 2022

Conversation

impact27
Copy link
Contributor

Every time a message is recieved on ipykernel while qt5 is activated, a QTimer and a QSocketNotifier leak. This closes the memory leak.

Fixes spyder-ide/spyder#19026

Every time a message is recieved on ipykernel while qt5 is activated, a `QTimer` and a `QSocketNotifier` leak. This closes the memory leak.

Fixes spyder-ide/spyder#19026
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 merged commit 8d3c88b into ipython:main Sep 13, 2022
jdranczewski added a commit to jdranczewski/ipykernel that referenced this pull request Feb 3, 2024
The QTimer was introduced in d4755f6 and then changed is issue ipython#990 to close a memory leak.
This change makes the code more concise by removing not instancing a QTimer object but calling the static singleShot method instead
jdranczewski added a commit to jdranczewski/ipykernel that referenced this pull request Feb 7, 2024
The default QTimer is coarse, so can fire within +-5% of the time specified.
We _need_ to fire after the delay specified so that we exit _after_ schedule_stop_aborting is scheduled.
The QTimer thus needs to be a PreciseTimer.
For small values of stop_on_error_timeout I found the QTimer _still_ fired up to 5ms too early, so added 10ms of delay offset.
singleShot signature is inconsistent between PySide and PyQt, so we store a timer object, similar to ipython#990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak with Matplotlib Qt/Automatic backend
2 participants