Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    freeing result of CurrentStatetoobject

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 410 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 28/06/2005 at 05:40, xxxxxxxx wrote:

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

      ---------
      Hi,

      I have a comprehension question. before R9 when calling MCOMMAND_CURRENTSTATETOOBJECT of ModelingCommanData it returned a baseobject as result. Now it returns an AtomArray.

      Ok, I can get the baseobjects out of it, but what´s the procedure for freeing the result now? Should I free the AtomArray or do I need to free all objects the AtomArray holds? When freeing the AtomArray does it automatically free the objects it holds?

      Thank you

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 28/06/2005 at 06:27, xxxxxxxx wrote:

        An easy test is to try and see what leaks you get 🙂 AFAIK, yes you should free the atom array and no the atom array does not free the objects, the atom array is just a list of pointers. HTH.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 28/06/2005 at 06:57, xxxxxxxx wrote:

          Hi Dave,

          🙂 I see (I thought I had leaks from this, but it seems another plugin brought up those). I found that the ModelingCommandData struct does free the AtomArray already on destruction. Doesn´t this make freeing the AtomArray obsolete? I don´t seem to get any leaks when not doing so (I only free the object that I use from the atom array), but I would like to be sure that I am on the safe side. 🙂

          Thank you!

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 28/06/2005 at 09:43, xxxxxxxx wrote:

            So it does, never noticed the destructor in operatingsystem 🙂

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

              On 28/06/2005 at 09:47, xxxxxxxx wrote:

              🙂 thank you

              1 Reply Last reply Reply Quote 0
              • First post
                Last post