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. ASSERT failure in QMutex::lock caused by copy to clipboard
QtWS25 Last Chance

ASSERT failure in QMutex::lock caused by copy to clipboard

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 6.3k 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.
  • C Offline
    C Offline
    crqt
    wrote on 18 Oct 2012, 13:04 last edited by
    #1

    I added a simple button to my application that would copy some text to the clipboard.

    If i press that button while using a debug build of my application (invoked from qtcreator), then when I close it down normally I get the following written to the Application Output a bunch of times.

    Invalid parameter passed to C runtime function.
    ASSERT failure in QMutex::lock: "Internal error, infinite wait has timed out.", file thread/qmutex.cpp, line 452
    Invalid parameter passed to C runtime function.

    Additionally another part of the application does something similar, calling QPlainTextEdit.copy(), and if I execute that code, the same thing error text is output.

    Is there something I'm doing wrong here?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guziemic
      wrote on 19 Oct 2012, 05:03 last edited by
      #2

      Do you unlock mutex after doing requested operation?

      1 Reply Last reply
      0
      • C Offline
        C Offline
        crqt
        wrote on 19 Oct 2012, 12:42 last edited by
        #3

        No, I did not explicitly unlock mutex. I don't see anywhere in the documentation for "QClipboard":http://qt-project.org/doc/qt-4.8/qclipboard.html#details, or "QPlainTextEdit::copy()":http://qt-project.org/doc/qt-4.8/qplaintextedit.html#copy where it says this is necessary.

        Maybe it is necessary, though if thats the case it seems like an oversight in the documentation...

        1 Reply Last reply
        0
        • U Offline
          U Offline
          UlfJohnsson
          wrote on 20 Dec 2012, 14:02 last edited by
          #4

          Hi!
          I'm having a very similar problem (perhaps even the same). I have a qtextedit, and when I copy the content using Ctrl+C and the shutdown the application I end up with the same assertions. You can work around this by clearing the clipboard when the application shuts down, but whats the correct way?
          BR, Ulf.

          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