Original Post
Hi, My design is to have most resources created through a factory-like mechanism, e.g.
CxxxResource *pResource = g_pEngine->GetxxxManager()->CreateResource(...);
The manager keeps track of the resources, however, so they shouldn't be able to be deleted. Is it OK to just make their destructors protected, and make the respective manager a friend class? Actually, going even further, is there any advantage in being able to create resources without a manager? I could make the c-tors protected as well. Anyway, any thoughts/opinions would be appreciated :)