Skip to content

drawImplicit: Avoid modifying list during iteration

David Gilbert requested to merge gilbert/kmplot:bug426025 into master

It's not safe to append to a QList while it's being iterated, because it might get realloc'd.

There's a corner case of drawImplicit where the 'singular' list is modified in an iteration loop, in at least some of those cases (when tan() is used) a crash happens due to that realloc and the iteration using the old data.

Fix by placing the new points on a separate list, and wrapping the loop by an outer loop which iterates until we don't add to the extra list.

BUGS: 426025, 435186

Merge request reports