MENUCOMMAND.FILE_EXIT might result in deadlock
A Python Scripting plugin for Notepad++
Status: Beta
Brought to you by:
davegb3
There's a test case over here:
https://sourceforge.net/projects/npppythonscript/forums/forum/1199074/topic/5294989
When I execute that command in the console, then N++ closes nicely.
So it only seems to happen when calling it in a callback function?
Or maybe just a N++ problem.
Urgh, yeah, it will be just in the callback. Without investigating, I'm guessing this is due to the cleanup on exit, and the cleanup waits for the python script to finish, the python script is waiting for N++ to finish.
I'll leave this open, and try and confirm that's what's happening. There's no easy answer though, other than maybe a notepad.exit() function, that copes specifically with the callback case?
I guess I'm even happy if you don't investigate into it.
I thought that it might probably be one of those 'native'
bugs, which you can only cover with hacks.
I mainly reported it simply because I noticed it,
just in case somebody else stumbles across it -
and finally everybody could be happy with a
sys.exit in the end? Also I'm sure it's an exceptional
use case in which you want N++ to shutdown..