Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix issues#162

Merged
seweber merged 3 commits intopairinteraction:masterpairinteraction/pairinteraction:masterfrom
johannes-moegerle:fix_issuesjohannes-moegerle/pairinteraction:fix_issuesCopy head branch name to clipboard
Jun 26, 2023
Merged

Fix issues#162
seweber merged 3 commits intopairinteraction:masterpairinteraction/pairinteraction:masterfrom
johannes-moegerle:fix_issuesjohannes-moegerle/pairinteraction:fix_issuesCopy head branch name to clipboard

Conversation

@johannes-moegerle
Copy link
Contributor

see #159 and #161

@hmenke
Copy link
Member

hmenke commented Jun 23, 2023

Maybe this could also be added to the patchset. This is to (possibly?) work around the test failure that I observed on Flathub: https://buildbot.flathub.org/#/builders/35/builds/5977/steps/8/logs/stdio

diff --git a/pairinteraction_gui/worker.py b/pairinteraction_gui/worker.py
index febc284e..b99ba013 100644
--- a/pairinteraction_gui/worker.py
+++ b/pairinteraction_gui/worker.py
@@ -16,6 +16,7 @@
 # along with the pairinteraction GUI. If not, see <http://www.gnu.org/licenses/>.
 from queue import Queue
 
+from PyQt5 import sip
 from PyQt5.QtCore import QThread, pyqtSignal
 
 
@@ -29,7 +30,8 @@ class Worker(QThread):
 
     def __del__(self):
         self.exiting = True
-        self.wait()
+        if not sip.isdeleted(self):
+            self.wait()
 
     def execute(self, stdout):
         self.stdout = stdout

@johannes-moegerle
Copy link
Contributor Author

We are also calling QThread.wait in pipy_thready.py (see PipyThread.terminate), as well as a few times directly in app.py.
Should this workaround also be added there?

@hmenke
Copy link
Member

hmenke commented Jun 26, 2023

I think the culprit here is that self.wait() is called inside __del__ and the Qt library has probably already freed all the memory already which leads to the crash.

@johannes-moegerle
Copy link
Contributor Author

The flathub fix fails in Linux / ubuntu. My guess is, this is due to PyQt5 being on version 5.14 instead of 5.15 as all the other builds.

# along with the pairinteraction GUI. If not, see <http://www.gnu.org/licenses/>.
from queue import Queue

from PyQt5 import sip
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from PyQt5 import sip
# https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#importing-the-sip-module
try:
from PyQt5 import sip
except ImportError:
import sip

Copy link
Member

@hmenke hmenke left a comment

Choose a reason for hiding this comment

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

Squash the fixup, then merge.

@seweber seweber merged commit ca3d9c4 into pairinteraction:master Jun 26, 2023
@johannes-moegerle johannes-moegerle deleted the fix_issues branch July 26, 2023 10:53
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.