Jump to content

Recommended Posts

Posted

Hello

I have a question:

in bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder)

When a check returns False, this is always used:

delete holder;

return false;

Why is delete holder always used with a return false? What is the purpose of this?

Posted

Yeah that's about it. C++ has manual memory management. You have to delete objects you create with new or the memory will never be released and accumulate. If the object is never properly added to be removed later it has to be released right away.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use