Releasing loaded resources

Hi,

I have loaded resources by using “cc.LoaderScene.preload” function.
I would like to unload resource after some time. Is there any method to unload?

Can anybody help us?

With best regards, Gurudath

Hi @Gurudath,

The preload resources have cached in cache manager by its type. For example, image has cached in cc.textureCache, spriteFrame plist has cached in cc.spriteFrameCache. If you want to release the resource, please call the removeTexture function of cc.textureCache for image.

BTW, cc.loader has cached some other resources, you can call release to release the resource by URL.

Hopes to help.
David

Hi @ludingping,

Thanks for the response. I will try this.

Regards,
Gurudath

Hi @ludingping,

Thanks for the solution. It works for me.