[PyQt] PyQt5 and temporary python interpreter in a C++ program

Pierre Barbier de Reuille pierre at barbierdereuille.net
Thu May 21 09:32:46 BST 2015


Ok, that's too bad :(
So I guess for now I'll keep a single interpreter for the whole time, and
if it ever gets fixed I'll be able to start/stop the interpreter ...

Thanks anyway,

Pierre

On Mon, 18 May 2015 at 19:32 Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 18/05/2015 6:19 pm, Pierre Barbier de Reuille wrote:
> > Hi,
> >
> > I have a C++ application that can be scripted with Python. As the
> > scripting
> > is very localized in time, I had originally chosen to initialize the
> > interpreter before each script, and finalize it after each script.
> >
> > This worked very well until I tried to use PyQt5 in my scripts! If I do
> > that, it works the first time, but on the next initialization, all the
> > modules are close to empty. In particular, they don't have any classes!
> >
> > As a temporary solution, I initialize the interpreter once at the start
> > of
> > my application, and re-use it over and over. But this is not ideal! In
> > particular, that would allow for resources leaks, which I would like to
> > avoid. Is this a known issue with PyQt? Is there something I can do to
> > make
> > this work?
>
> Neither sip or PyQt do a very good job about tidying up on finalisation.
> There is no one specific thing - just lots of little ones. Fixing it has
> just been low priority.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150521/0af7c13f/attachment.html>


More information about the PyQt mailing list