Skip to content

Commit

Permalink
Wait for renderloop task to stop before restoring close_after_renderl…
Browse files Browse the repository at this point in the history
…oop value
  • Loading branch information
jmert committed May 23, 2024
1 parent 20f457b commit bc071b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,6 @@ function stop_renderloop!(screen::Screen; close_after_renderloop=screen.close_af
c = screen.close_after_renderloop
screen.close_after_renderloop = close_after_renderloop
screen.stop_renderloop = true
screen.close_after_renderloop = c

# stop_renderloop! may be called inside renderloop as part of close
# in which case we should not wait for the task to finish (deadlock)
if Base.current_task() != screen.rendertask
Expand All @@ -853,6 +851,7 @@ function stop_renderloop!(screen::Screen; close_after_renderloop=screen.close_af
screen.rendertask = nothing
end
# else, we can't do that much in the rendertask itself
screen.close_after_renderloop = c
return
end

Expand Down

0 comments on commit bc071b3

Please sign in to comment.