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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flent/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,7 @@ def __init__(self, parent, settings, worker_pool):
self.plotter = None
self.canvas = None
self.needs_resize = False
self.was_destroyed = False

self.new_plot.connect(self.get_plotter)
self.async_fig = None
Expand Down Expand Up @@ -2179,6 +2180,7 @@ def load_results(self, results, plot=None):
def disconnect_all(self):
for s in (self.update_start, self.update_end, self.plot_changed):
s.disconnect()
self.was_destroyed = True

def disable_cleanup(self):
if self.plotter is not None:
Expand Down Expand Up @@ -2336,6 +2338,8 @@ def redraw(self):
self.setCursor(Qt.WaitCursor)

def recv_plot(self, fig):
if self.was_destroyed:
return
self.new_plot.emit()

def get_plotter(self):
Expand Down
Loading