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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Missing FreeTool() call with ToolData

    Scheduled Pinned Locked Moved Bugs
    6 Posts 0 Posters 1.5k 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 06/01/2004 at 10:22, xxxxxxxx wrote:

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

      ---------
      there is a missing FreeTool() call if the tool is active and you quit Cinema4D.

      Tool Data
                virtual void      FreeTool(BaseDocument *doc, BaseContainer &data;);

      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 06/01/2004 at 11:52, xxxxxxxx wrote:

        Hi Klaus,
        I don´t think this is a bug. The FreeTool function is meant to be called when switching tools not when leaving Cinema4D. You can use your destructor to free allocated memory when C4D quits.

        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 10/01/2004 at 14:46, xxxxxxxx wrote:

          It should be called, otherwise it doesn't make sense to use InitTool().

          F.e. if InitTool() creates temp-objects in the scene and FreeTool() deletes this, this objects are still there if you quit (and save the scene).

          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 11/01/2004 at 09:44, xxxxxxxx wrote:

            Quote: Originally posted by Klaus Karlhuber on 10  January 2004
            >
            > * * *
            >
            > It should be called, otherwise it doesn't make sense to use InitTool().
            >
            > Sorry but why doesn´t it make sense? InitTool is called when the tool is chosen and FreeTool is called when the tool is switched (to another tool). Makes sense to me.
            >
            >
            > Quote: Originally posted by Klaus Karlhuber on 10  January 2004
            >
            > * * *
            >
            >
            > F.e. if InitTool() creates temp-objects in the scene and FreeTool() deletes this, this objects are still there if you quit (and save the scene).
            >
            > * * *
            That´s why I said you should use your destructor :=) It will definetly be called and you can free any resources you allocated in InitTool() if the user quits Cinema 4D with your tool active.

            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 12/01/2004 at 03:46, xxxxxxxx wrote:

              Yes of course you can go around this problem with the destructor-method. But it would be more convenience if there is a FreeTool call at the end.

              F.e. if you need doc in the destructor, you have to store it at the InitTool-call. Therefore this end-call of FreeTool would solve all this workarounds. It's maybe not the correct forum, because it's not really a bug - but there is no ideas/suggestions-forum.

              The Maxon-Coder should decide if it makes sense to change this.

              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 12/01/2004 at 06:11, xxxxxxxx wrote:

                Yes, I agree that it would probably be more convenient and as a suggestion I think it´s good 🙂

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