code icon indicating copy to clipboard operation
code copied to clipboard

Fix crash in vala outline when entering some invalid code

Open jeremypw opened this issue 2 years ago • 0 comments

Fixes #1355

The root of the issue is in the libvala library - the parser never finishes on some invalid code lines and there is no obvious way of cancelling it.

To fix the crashes this PR ensures that if one parsing thread stalls and never finishes, a new one is not started.

A limitation of this is that if the code is edited to fix the problematic line, the outline is not re-parsed until the outline pane is hidden and then shown again (or the document closed and reopened - this PR ensures the outline is destroyed on closing the document).

It is questionable whether this issue is likely to occur often enough warrant implementing a more complex fix.

Any advice on how to force the thread to end when the parser has stalled would be welcome.

jeremypw avatar Jul 20 '23 22:07 jeremypw