Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpcUaNode *QOpcUaClient::node(const QString &nodeId) delete or not?

QOpcUaNode *QOpcUaClient::node(const QString &nodeId) delete or not?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 364 Views 1 Watching
  • 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.
  • B Offline
    B Offline
    Bremenpl
    wrote on last edited by
    #1

    Hello there,
    I have a question regarding the node method from QOpcUaClient Class ( https://doc.qt.io/QtOPCUA/qopcuaclient.html#node ).

    It returns a pointer to a node object. What I was wondering is either after I am done with working with this returned node, should I free the memory under this pointer? Is new memory allocated each time the node method is called?

    I would appreciate all help.

    lprzenioslo.zut.edu.pl

    jsulmJ 1 Reply Last reply
    0
    • B Bremenpl

      Hello there,
      I have a question regarding the node method from QOpcUaClient Class ( https://doc.qt.io/QtOPCUA/qopcuaclient.html#node ).

      It returns a pointer to a node object. What I was wondering is either after I am done with working with this returned node, should I free the memory under this pointer? Is new memory allocated each time the node method is called?

      I would appreciate all help.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Bremenpl

      "QOpcUaNode *QOpcUaClient::node(const QString &nodeId)

      Returns a QOpcUaNode object associated with the OPC UA node identified by nodeId. The caller becomes owner of the node object."
      From https://doc-snapshots.qt.io/qtopcua/qopcuaclient.html#node
      So, you have to free the memory.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • B Offline
        B Offline
        Bremenpl
        wrote on last edited by
        #3

        Had a same impression but needed a second opinion. Thanks.

        lprzenioslo.zut.edu.pl

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved