Re: [Jepp-users] jep.close() exits my application
Brought to you by:
mrjohnson0
From: Tijs W. <Tij...@be...> - 2014-01-09 22:53:08
|
Hi Fabrice, I guess there are 2 options to solve this: 1) Make all jep calls from the same thread, or 2) Use the python threading module to wait for other threads I use (and recommend) option 1. For example, when run from an Eclipse plugin, I do all Jep calls from the gui thread: Display.getDefault().asyncExec(new Runnable() { @Override public void run() { StopPythonInterpreter(); } If you need background work, you can always use the python threading module to spawn a new python thread. Before exiting jep, do your own python logic to ensure other threads are done ( a join() , or an Event(), whatever you want). Hope this helps, cheers TW From: Fabrice Ilponse [mailto:il...@ma...] Sent: donderdag 9 januari 2014 15:45 To: jep...@li... Subject: [Jepp-users] jep.close() exits my application Hello, I get the error "Fatal Python error: Py_EndInterpreter: thread still has a frame" when I try to call jep.close() I do not see what I'm doing wrong. On google it said that this comes from a test on tstate->frame != NULL in the native python library. The problem with this error is that my application is ended brutally. In my case, I'm running jep in a job but closing it by an action outside this job (graphical button). This does not occur in my other example which does not use a job. Does anyone know what is happening and if I must call some other jep method a clear things before closing it? Regards, Fabrice ________________________________ Bertus Groothandel & Distributie B.V. Akeleibaan 59 2908KA Capelle aan den IJssel The Netherlands Op al onze transacties zijn onze Algemene Verkoop- en Leveringsvoorwaarden van toepassing. Deze voorwaarden treft u aan op de achterzijde van onze factuur en op onze website www.bertus.com. Andersluidende voorwaarden worden uitdrukkelijk afgewezen. Our General Sales and Delivery Conditions apply to all transactions. Please find these general conditions on the back of our invoice and on our website www.bertus.com. The applicability of any other general conditions is expressly rejected. Registered in Rotterdam No. 24156512 |