<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Lukáš Lalinský wrote:
<blockquote cite="midek10kn$usa$1@sea.gmane.org" type="cite">
  <pre wrap="">Matt Chambers  wrote / napísal(a):
  </pre>
  <blockquote type="cite">
    <pre wrap="">Using PyQt 4.0 and Qt 4.1.  I'm emitting a single from a QThread with a
single argument.   About 50% of the time when  I catch
the signal and execute the slot function, the argument is a QMutex
object, not the argument I emitted with the signal.

Here is my threads run() function.

    </pre>
  </blockquote>
  <pre wrap=""><!---->[...]
  </pre>
  <blockquote type="cite">
    <pre wrap="">Notice I'm emitting the signal with a cuejob.CueJob object, but from the
slot, when I print the first argument, I get:
&lt;PyQt4.QtCore.QMutex object at 0xf6b0b22c&gt;
    </pre>
  </blockquote>
  <pre wrap=""><!---->
There are two problems with the code:

1. Don't use "short-circuit" signals for communication between threads. The slot
will be called from the same thread, not via the queued connection from the main
thread, which is probably what you want. Use
QtCore.SIGNAL("parsingComplete(PyObject*)") instead.

2. Keep references to the emit arguments, otherwise they will get deleted and
replaced with a different objects that reuse the same memory block.

  </pre>
</blockquote>
Fixing those two things worked thanks!<br>
<br>
<br>
</body>
</html>