On 04/09/2017 at 03:45, xxxxxxxx wrote:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
looking for some clarification on allocating and deallocating memory.
When should an ObjectData inherited class destroy its data? Should this be done in the destructor, or should I be overriding Free()? Something else?
Similar question for the constructor. In my custom classes I set all pointers to nullptr in the constructor, and usually allocate the memory elsewhere (I setup my own initialiser functions). But in my ObjectData plugins I do this in the constructor. Should I be doing this in the Init() function? I read a post here from a few years a go that said the Init() might be called more than once - why might this happen? And should I therefore be setting up tests inside the Init() function?
Edit - spelling error!