To dispose of a Spine WebGL context, you can use the dispose()
method on objects that have underlying native resources, such as textures or buffers. However, if this.spinePlayer.dispose()
is not releasing the context as expected, it might be due to the way the context is managed or other resources still being referenced. Unfortunately, there isn't a built-in global method to kill all Spine contexts at once. You would need to ensure that all resources associated with each context are properly disposed of individually. This includes removing any references to the WebGL context and ensuring that all associated resources are released.
For a more comprehensive cleanup, you might need to manually remove the canvas element from the DOM or ensure that all rendering calls are stopped. If you are using multiple contexts, make sure each one is disposed of properly by iterating over them and calling their respective dispose()
methods.