Skip to content

Commit

Permalink
Exit the postthread functions early if thread is running again
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jun 15, 2018
1 parent 80dcbf6 commit 3304434
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions glue/viewers/histogram/layer_artist.py
Expand Up @@ -105,6 +105,12 @@ def _calculate_histogram_thread(self, reset=False):
self.state.update_histogram()

def _calculate_histogram_postthread(self):

# If the worker has started running again, we should stop at this point
# since this function will get called again.
if self._worker.running:
return

self.notify_end_computation()
self._update_artists()
self._update_visual_attributes()
Expand Down
5 changes: 5 additions & 0 deletions glue/viewers/profile/layer_artist.py
Expand Up @@ -108,6 +108,11 @@ def _calculate_profile_thread(self, reset=False):

def _calculate_profile_postthread(self):

# If the worker has started running again, we should stop at this point
# since this function will get called again.
if self._worker.running:
return

self.notify_end_computation()

visible_data = self.state.profile
Expand Down

0 comments on commit 3304434

Please sign in to comment.