pex-gl / pex-context

Modern WebGL state wrapper for PEX: allocate GPU resources (textures, buffers), setup state pipelines and passes, and combine them into commands.
http://pex-gl.github.io/pex-context/
MIT License
160 stars 12 forks source link

Disposing context crashes on pipeline dispose #75

Closed vorg closed 4 years ago

vorg commented 4 years ago

Trying to dispose resource from another context

If pipeline has created programs those will be disposed first inside context dispose loop https://github.com/pex-gl/pex-context/blob/master/index.js#L1198 then pipeline gets disposed too decreases program.refCount to 0 and tries to dispose it again. Context can't find it in the resource array and thinks that the program is from another context.