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. [SOLVED] timers cannot be stopped from a different thread

[SOLVED] timers cannot be stopped from a different thread

Scheduled Pinned Locked Moved General and Desktop
qtimerqthreads
4 Posts 3 Posters 33.5k Views
  • 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.
  • J Offline
    J Offline
    jhowland
    wrote on 23 Apr 2015, 17:47 last edited by jhowland
    #1

    I have some multi-threaded code, written in the moveToThread mode--I also use QRunnables. When I exit my program, I get a message--on both linux and Windows--
    QObject::~QObject: Timers cannot be stopped from another thread

    I don't use any timers in my program. None. The string "timer" does not occur anywhere in my own code.

    Is it being used by the API somewhere? How can I stop this from happening?

    J 1 Reply Last reply 23 Apr 2015, 23:46
    0
    • M Offline
      M Offline
      mcosta
      wrote on 23 Apr 2015, 19:30 last edited by
      #2

      Hi and welcome to devnet,

      you can try executing you application with debugger and verify where and how timers are started stopped.
      Could you post some parts of code?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • J jhowland
        23 Apr 2015, 17:47

        I have some multi-threaded code, written in the moveToThread mode--I also use QRunnables. When I exit my program, I get a message--on both linux and Windows--
        QObject::~QObject: Timers cannot be stopped from another thread

        I don't use any timers in my program. None. The string "timer" does not occur anywhere in my own code.

        Is it being used by the API somewhere? How can I stop this from happening?

        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 23 Apr 2015, 23:46 last edited by
        #3

        Hi @jhowland,

        Each QObject has a built-in timer. Qt might use it for internal purposes

        QObject::~QObject: Timers...

        The part before ": Timers" shows the function which produced this message. In your case, it is a QObject destructor. This suggests that an object is getting deleted in the wrong thread.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        J 1 Reply Last reply 24 Apr 2015, 13:55
        2
        • J JKSH
          23 Apr 2015, 23:46

          Hi @jhowland,

          Each QObject has a built-in timer. Qt might use it for internal purposes

          QObject::~QObject: Timers...

          The part before ": Timers" shows the function which produced this message. In your case, it is a QObject destructor. This suggests that an object is getting deleted in the wrong thread.

          J Offline
          J Offline
          jhowland
          wrote on 24 Apr 2015, 13:55 last edited by
          #4

          @JKSH Thanks--this helped me solve the problem. In a GUI thread, I was using exit()--when I should have just used emit finished()

          1 Reply Last reply
          0

          1/4

          23 Apr 2015, 17:47

          • Login

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