Skip to content

Commit 4d106cf

Browse files
committed
fix another incorrect free
1 parent c07e4b9 commit 4d106cf

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Diff for: GLMakie/src/GLAbstraction/GLTypes.jl

+13
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ include("GLRenderObject.jl")
431431
####################################################################################
432432
# freeing
433433

434+
# const TRACE_FREE = Ref(false)
435+
434436
function free(x::T, called_from_finalizer = false) where {T}
435437
# don't free if already freed (this should only be set by unsafe_free)
436438
x.id == 0 && return
@@ -439,6 +441,17 @@ function free(x::T, called_from_finalizer = false) where {T}
439441
# to be active or alive here, because unsafe_free() may also do
440442
# cleanup that doesn't depend on context
441443

444+
# if TRACE_FREE[]
445+
# try
446+
# error("tracing...")
447+
# catch e
448+
# bt = catch_backtrace()
449+
# Threads.@spawn begin
450+
# @warn "free(::$T)" exception = (e, bt)
451+
# end
452+
# end
453+
# end
454+
442455
# This may be called from the scene finalizer in which case no errors and
443456
# no printing allowed from the current task
444457
if called_from_finalizer

Diff for: GLMakie/src/gl_backend.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function get_texture!(context, atlas::Makie.TextureAtlas, called_from_finalizer
3939
catch e
4040
if called_from_finalizer
4141
Threads.@spawn begin
42-
@error "Cached atlas textures should be removed explicitly!" exception = (e, catch_backtrace())
42+
@error "Cached atlas textures should be removed explicitly! Dropping $(tex_func[1].id)" exception = (e, catch_backtrace())
4343
end
4444
else
45-
@error "Cached atlas textures should be removed explicitly!" exception = (e, catch_backtrace())
45+
@error "Cached atlas textures should be removed explicitly! Dropping $(tex_func[1].id)" exception = (e, catch_backtrace())
4646
end
4747
end
4848
tex_func[1].id = 0 # Should get cleaned up when OpenGL context gets destroyed

Diff for: GLMakie/src/postprocessing.jl

+1
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ function construct(::Val{:FXAA1}, screen, framebuffer, inputs, parent)
399399
loadshader("postprocessing/postprocess.frag"),
400400
view = Dict("FILTER_IN_SHADER" => filter_fxaa_in_shader ? "#define FILTER_IN_SHADER" : "")
401401
)
402+
filter_fxaa_in_shader || pop!(inputs, :objectid_buffer)
402403
robj = RenderObject(inputs, shader, PostprocessPrerender(), nothing, screen.glscreen)
403404
robj.postrenderfunction = () -> draw_fullscreen(robj.vertexarray.id)
404405

Diff for: GLMakie/test/glmakie_refimages.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ end
170170
end
171171

172172
@reference_test "render stage parameters with SSAO postprocessor" begin
173-
GLMakie.closeall()
173+
GLMakie.closeall() # (mostly?) for recompilation of plot shaders
174174
GLMakie.activate!(ssao = true)
175175
f = Figure()
176176
ps = [Point3f(x, y, sin(x * y + y-x)) for x in range(-2, 2, length=21) for y in range(-2, 2, length=21)]

0 commit comments

Comments
 (0)