General help with memory cleanup, etc



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2003 at 11:06, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   6.3 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    I am STILL working on this Renderman RIB exporter plugin, and need some help on memory allocation issues.

    • When do I need to use GeAlloc and the like?
    • What do I need to free or destroy at the end of the plugin?

    In my plugin I need to grab objects, texture tags, UV tags, etc. Right now I just define all these as variables (BaseObject *object ; BaseObject *cameraob; BaseTag *ptag; BaseMaterial *material; BaseChannel *channel;  BaseContainer chcontainer; etc), assign them various things as the plugin progresses, and thats about it. Do I need to worry about memory freeing in these instances? Do I need to define the variables differently?
    Thanks for any help.
    matt



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2003 at 11:18, xxxxxxxx wrote:

    Hi Matt,
    no, you don´t have to worry about them. Generally Cinema 4D is doing this for you. If you are allocating them yourself with BaseObject::Alloc() i.e. you will have to free them after usage yourself either by calling BaseObject::Free(obj) or insert them into a document/scene.
    Actually if you are allocating memory with GeAlloc you will need to free this by yourself with GeFree(memorytofree);


Log in to reply