File handle left open after script parsing error
Submitted by Richard Gitschlag
Please describe the problem: I was working on my first GIMP script last night (using WordPad), so it was not much surprise that I encountered a few problems....
After registering the script, GIMP displayed a parse error ("end of file while inside list") because I had not nested my parentheses properly. I carefully combed over my script (in WordPad) and ultimately located and addressed the problem, however when I tried to save the file Windows denied me access, saying "the file is in use by another application".
Steps to reproduce: 0. Start GIMP.
- Open any script for editing (I use Wordpad).
- Add or remove a parentheses (to induce a parsing error).
- Refresh all GIMP scripts - naturally, it should display an error that the script could not be parsed.
- Return to the script, remove the bug and save the script file again.
Actual results: On step #4, WordPad tells me the file is "in use by another application" (i.e. GIMP) and "cannot be accessed", and I am unable to save my changes or fix the parse error.
Expected results: I should, of course, have been able to save my changes and refresh the scripts with the new version.
Does this happen every time? Unfortunately, no. I was on some occasions able to save changes to my script file and properly refresh the scripts, but once the error occured, I had to shut down GIMP before I could save any further changes to my script, and then restart GIMP to see if those changes had any effect. Turns out my script had several parse errors (last night was quite the crash course in script-fu), and I ultimately must have rebooted GIMP a dozen times before all the parse errors were finally nailed and I could actually run the script file on my image (to discover, of course, that I had yet more script errors to debug).
Version: git master