Bug 416037 - When I use python scripting, kig crash select the exit menu entry instead closing
Summary: When I use python scripting, kig crash select the exit menu entry instead clo...
Status: REPORTED
Alias: None
Product: kig
Classification: Applications
Component: general (show other bugs)
Version: 19.11.80
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David E. Narvaez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-09 11:05 UTC by Franco Pasquarelli
Modified: 2020-01-18 05:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kig crash report (2.37 KB, text/plain)
2020-01-09 11:05 UTC, Franco Pasquarelli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franco Pasquarelli 2020-01-09 11:05:31 UTC
Created attachment 124988 [details]
kig crash report

SUMMARY


STEPS TO REPRODUCE
1. start kig
2. use python scripting
3. select exit menu entry

OBSERVED RESULT
kig crash

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maurizio Paolini 2020-01-09 17:26:09 UTC
I can confirm this behaviour:  if a kig construction contains a PythonScript object, then kig crashes upon closing it.

As reported to me by Franco, the problem is apparently in the destructor

PythonScripter::~PythonScripter()
{
  PyErr_Clear();
  Py_Finalize();
  delete d;
}

As noted by Franco, the problem disappears upon moving the 'delete d' before the Py_Finalize() call
Comment 2 Maurizio Paolini 2020-01-11 18:56:35 UTC
Git commit 211f8501ec4cf77ed68253783d58a662b5513612 by Maurizio Paolini.
Committed on 11/01/2020 at 18:50.
Pushed by paolini into branch 'master'.

Fix crash upon exit after transition python2 -> python3 when using scripting (bug #416037)

Reviewed By: kkevin
Differential Revision: https://phabricator.kde.org/D12833

M  +1    -1    scripting/python_scripter.cc

https://commits.kde.org/kig/211f8501ec4cf77ed68253783d58a662b5513612
Comment 3 Kevin Kofler 2020-01-11 21:12:35 UTC
For next time: my KDE username is actually kkofler, not kkevin. :-)
Comment 4 Maurizio Paolini 2020-01-18 05:51:02 UTC
Git commit faec9ac0f6f73e312dc051ce34eaf3154d456e96 by Maurizio Paolini.
Committed on 18/01/2020 at 05:47.
Pushed by paolini into branch 'master'.

Going back to original Py_Finalize() to maintain compatibility with pithon2 and earlier versions of python3

Reviewed By: wbauer
Differential Revision: https://phabricator.kde.org/D26550

M  +2    -1    scripting/python_scripter.cc

https://commits.kde.org/kig/faec9ac0f6f73e312dc051ce34eaf3154d456e96