I'm trying to use a custom C++ engine with glut.
How can I free/delete data?
for example,
https://www.kestrelmoon.com/creaturedoc ... times.html
CreatureModule::CreatureLoadDataPacket json_data;
CreatureModule::LoadCreatureJSONData(filename, json_data);
auto cur_creature = std::shared_ptr<CreatureModule::Creature>(new CreatureModule::Creature(json_data));
creature_manager = new CreatureModule::CreatureManager(cur_creature);
creature_manager->CreateAnimation(json_data, "default");
creature_manager->CreateAnimation(json_data, "second");
above case,
how can I free cur_creature, etc?
delete cur_creature;
??
I'm thinking about how to load and delete various JSON data.
Explicit data freeing in custom C++ runtime
Re: Explicit data freeing in custom C++ runtime
Hello,
A shared_ptr will free itself once its reference count drops to 0.
You can learn more about it here:
https://www.oreilly.com/library/view/ef ... /ch04.html
Thanks
A shared_ptr will free itself once its reference count drops to 0.
You can learn more about it here:
https://www.oreilly.com/library/view/ef ... /ch04.html
Thanks