xpmfetch with datget

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf xpmfetch with datget

  • Creator
    Topic
  • #50148
    Alice Kazin
    Participant

      We are using xpmfetch and datget in a tcl proc.  Do we need to use “datdestroy” in order to free memory used by the datums?

    Viewing 5 reply threads
    • Author
      Replies
      • #65013
        Robert Milfajt
        Participant

          The school of thought is if you create it you need to destroy it.

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #65014
          Alice Kazin
          Participant

            We are just using xpmfetch in a tcl fragment.    We are not using grmcreate or datcreate.   According to the documentation, when “datcreate” or “grmcreate” is used to create the datum then the datum remains in memory until destroyed.

          • #65015
            John Hamilton
            Participant

              Use the testing tool.

              Turn on leak Detection.

              If it detects a leak then you need to destroy it.

              That is the best way I know to test things for leaks and just to make sure code is doing not only what you think it should but what you told it to do.

            • #65016
              Alice Kazin
              Participant

                It lists the datums at the beginning but nothing is displayed after “checking for leaks”.

              • #65017
                Robert Milfajt
                Participant

                  It appears the law of conservation applies to datums as well.  I would say that since you did not create them, you do not need to destroy them.

                  Robert Milfajt
                  Northwestern Medicine
                  Chicago, IL

                • #65018
                  Rob Abbott
                  Keymaster

                    I am reasonably sure you need to destroy the dat handles created by grmfetch/xpmfetch.  

                    You can either destroy them individually with datdestroy or use hcidatlistreset to destroy any handles created while your proc was running.

                    To use hcidatlistreset, do the following

                    at the top of your upoc:

                    Code:

                    set datList [datlist]

                    At the bottom of your proc, or before any return statement

                    Code:

                    hcidatlistreset $datList

                    Rob Abbott
                    Cloverleaf Emeritus

                Viewing 5 reply threads
                • The forum ‘Cloverleaf’ is closed to new topics and replies.