Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8865

Improve documentation of QDBusPendingCallWatcher

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.6.2
    • D-Bus
    • None

    Description

      The #details documentation of QDBusPendingCallWatcher (http://doc.trolltech.com/4.6/qdbuspendingcallwatcher.html#details) does not provide any information about the necessary lifetime of a QDBusPendingCallWatcher. Using the sample code as reference, will most probably result in wasted memory, as an instance of QDBusPendingCallWatcher will be created for each asynchronous call, but never deleted [*].

      I'd suggest to add the line:
      call->deleteLater();
      at the end of the method MyClass::callFinishedSlot().

      [*] Of course all the instances get deleted when the parent gets deleted, but in a typical usecase the parent might stay alive until the application gets shutdown.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
            ppenz Peter Penz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes