When an entity or other object needs access to a resource, it passes in the id (string or whatever) to the resource manager to get a pointer which points to the resource. a smart pointer (boosts shared_pointer) will automatically destroy the resource after there are no more pointers to the resource.