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

    please help with GetRealSpline/Memoryleak

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 289 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 22/05/2009 at 12:42, xxxxxxxx wrote:

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

      ---------
      Hi , i am using this code to get a user spline from an input field and create a clone to be able to for example read out points with "vPosition = splineObj->GetSplinePoint(ccpos, 0, NULL);"

        
      if(userSpline)       
      {             
      splineObj = ((BaseObject* )(userSpline->GetClone(COPY_NO_BITS, NULL)))->GetRealSpline();  
      }  
        
      everything works well, except that once again i have a memory leak. i think i have to free something, but what?? it isnt the splineObj, but i guess its something that happens when using GetRealSpline().. which i need to use, since the use should be able to use parametric splines...  
        
      thanks for any hints,  
      cheers, ello  
      
      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 22/05/2009 at 13:28, xxxxxxxx wrote:

        The memory leak is your clone, I guess.
        You should store the pointer to the clone in a separate Variable, get the real spline from it and then free the clone after use.

        Cheers,
        Jack

        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 22/05/2009 at 13:52, xxxxxxxx wrote:

          thank you.. got it working

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