I’m using boost::shared_ptr to store a pointer to texture. I’m loading new textures as i need and share them among the program using shared_ptr. If my app is using too much memory i want to remove unused textures to clear memory. Is there a way I can determine how many objects are having access to the texture via shared_ptr ?
I’m using boost::shared_ptr to store a pointer to texture. I’m loading new textures as
Share
If it’s unused then the
shared_ptrwill free it automatically. That’s the point ofshared_ptr. If you are holding ashared_ptrto a texture without actually using it, then you’re violating the contract ofshared_ptrand should not be using it.