Recommended way of disposing of image data used to create textures

I create an ImageBitmap using the global function createImageBitmap(). I then pass the ImageBitmap to Texture’s setSource method. I tried disposing of the ImageBitmap by calling it’s close method but then no textures appear. I thought Texture.setSource() would upload it to the GPU but looking at PlayCanvas’s code it only seems to do it for WebGPU via uploadImmediate method. Not sure when it does it for WebGL, probably before rendering. What is the recommended way of disposing of image data that is used to create textures?