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. QWaitCondition as a class member ?

QWaitCondition as a class member ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 207 Views 2 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.
  • D Offline
    D Offline
    dpcrd
    wrote on last edited by dpcrd
    #1

    I tried to declare a QWaitCondition as a class member of a worker class, like in this post. But it doesn't work : wakeAll() crashes the app.

    However, if I declare it at the top of the worker class .cpp file, it works. Why is that ?

    Chris KawaC 1 Reply Last reply
    0
    • D dpcrd

      I tried to declare a QWaitCondition as a class member of a worker class, like in this post. But it doesn't work : wakeAll() crashes the app.

      However, if I declare it at the top of the worker class .cpp file, it works. Why is that ?

      Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @dpcrd Most likely you're calling wakeAll and destroy the worker along with the QWaitCondition variable, so other threads that wait on it crash, or something like that. Without looking at the code it's just guessing though.

      D 1 Reply Last reply
      2
      • Chris KawaC Chris Kawa

        @dpcrd Most likely you're calling wakeAll and destroy the worker along with the QWaitCondition variable, so other threads that wait on it crash, or something like that. Without looking at the code it's just guessing though.

        D Offline
        D Offline
        dpcrd
        wrote on last edited by dpcrd
        #3

        The new instruction to create the worker object was malformed... Stupid me.

        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