[Interest] Never ending thread: blocking GUI

Sensei senseiwa at gmail.com
Tue Oct 16 17:00:17 CEST 2012

On 10/16/12 3:34pm, Lincoln Ramsay wrote:
> You want an async QObject-based interface (call in via slot, answer via
> signal).

I see what you mean. I went this way and I'm quite happy, so thanks a lot!

Here's the awesome output with two different threads!

emitting signal on thread 0x7fff7cee6180
searching in thread 0x1041f7000
scanning 'a.txt'
scanning 'b.txt'
scanner returned 'hello world!', this is thread 0x7fff7cee6180

One question regarding (possible?) memory leaks.

So, if in my main thread every time I need to search I will create a 
thread, a searcher, move the searcher to the new thread. When a signal 
is emitted, the control is transferred to the thread executing the 
search. Upon completion, the slot emits a signal, and this triggers 
control to get back to the main thread, to print the output from the 
search (gets back there because it might be somewhere else, search might 
take some time!)

Am I leaking memory? I understand that I'm doing so.

How can I delete these objects?

I mean the thread, searcher, and their parameters, in this case.


More information about the Interest mailing list