[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: Memory leak when using PyQt with OpenNMT CTranslate
From:       Giuseppe Corbelli <corbelligiuseppe () mesdan ! it>
Date:       2020-11-05 11:31:45
Message-ID: 3a599019-fc56-148d-a77a-fec930b9fe7d () mesdan ! it
[Download RAW message or body]

On 11/5/20 2:54 AM, Admin Argos Open Technologies, LLC wrote:
> Hi Giuseppe,
> 
> Thanks for the response. What do you mean by "call the base class event 
> loop (QThread::run())"? My understanding was that my code is 
> reimplementing QThread::run in a subclass of QThread and that 
> QThread::run is called via QThread::start. Also I think that the event 
> loop is run by QApplication::exec_.

Well, if you want your thread to interact with main app using signals & 
slots you need to have an event loop for each thread (and use 
moveToThread where necessary). That's what the QThread::run() does.

Yes, you call start() and run() is called. Remember that thread exits 
when run() returns.

> I was able to decently work around this issue so it's not a major 
> problem for me anymore but I haven't been able to find any explanation 
> for why the posted code leaks memory.
Ah well, regarding the memory leak I did not look into the details so I 
have no suggestion.

-- 
Giuseppe Corbelli
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic