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

gui: Don't try to redraw received plot if widget was removed #289

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

tohojo
Copy link
Owner

@tohojo tohojo commented Oct 3, 2023

@mahsan76 reports:

There is an issue in Flent 2.0.1 , after loading multiple test files ( e.g 5 or 6 ) and adding combining them,
when i click close all tab , it works ok and all tabs are closed...
but then when i want to open 5 or 6 files again , the process gets stuck with the following exception in ubuntu bash terminal:

#########################################################################################
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.9/multiprocessing/pool.py", line 592, in _handle_results
cache[job]._set(i, obj)
File "/usr/lib/python3.9/multiprocessing/pool.py", line 776, in _set
self._callback(self._value)
File "/usr/share/flent/flent/gui.py", line 2329, in recv_plot
self.new_plot.emit()
RuntimeError: wrapped C/C++ object of type ResultWidget has been deleted

Fix this by keeping track of when a widget is destroyed, and cancel any plot updates after this happens.

The async plotting code can return after a tab was closed, which leads to a
crash when trying to redraw a widget that has already been destroyed. Keep track
of when we disconnect the ResultWidget, and abort the async draw callback if the
widget was already disconnected.

Reported-by: Muhammad Ahsan <[email protected]>
Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
@tohojo tohojo changed the title Flent 2.0.1 using Python 3.9.5. crashes in ubuntu 21 gui: Don't try to redraw received plot if widget was removed Oct 3, 2023
@tohojo tohojo merged commit e8e8adf into master Oct 16, 2023
50 of 53 checks passed
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.

1 participant