Skip to content

Commit

Permalink
fix #2794
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Mar 21, 2023
1 parent 54b0587 commit cc7ef10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions GLMakie/test/unit_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ end
text!(ax, [Point2f(2)], text=["hi"])
screen = display(fig)
empty!(fig)
@test screen in fig.scene.current_screens
@testset "all got freed" begin
for (_, _, robj) in screen.renderlist
for (k, v) in robj.uniforms
Expand Down
3 changes: 3 additions & 0 deletions src/figures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ function resize_to_layout!(fig::Figure)
end

function Base.empty!(fig::Figure)
screens = copy(fig.scene.current_screens)
empty!(fig.scene)
# The empty! api doesn't gracefully handle screens for e.g. the figure scene which is supposed to be still used!
append!(fig.scene.current_screens, screens)
empty!(fig.scene.events)
foreach(GridLayoutBase.remove_from_gridlayout!, reverse(fig.layout.content))
trim!(fig.layout)
Expand Down

2 comments on commit cc7ef10

@SimonDanisch
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request updated: JuliaRegistries/General/80006

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.19.3 -m "<description of version>" cc7ef1015e97f57c5a6cdfb2606531d7c6bdc082
git push origin v0.19.3

Please sign in to comment.