-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault when removing bezier spline point #571
Comments
I'm guessing you probably didn't mean to take a reference to |
Yes, unfortunately the SolveSpace codebase has a mix of legacy code with more modern C++ and it doesn't always work well. Could you prepare a pull request? I didn't look into your fix closely but it sounds correct to me. |
This was incorrectly capturing `r` by reference and using it after it left its scope. Changed to capture by value, and also explicitly capture `this` in case we were accidentally capturing any other scope variables by reference. Fixes solvespace#571
This was incorrectly capturing `r` by reference and using it after it left its scope. Changed to capture by value, and also explicitly capture `this` in case we were accidentally capturing any other scope variables by reference. Fixes #571
This was incorrectly capturing `r` by reference and using it after it left its scope. Changed to capture by value, and also explicitly capture `this` in case we were accidentally capturing any other scope variables by reference. Fixes solvespace#571
System information
SolveSpace version: 3.0~645353cb
Operating system: Windows 10
Expected behavior
Add a bezier curve with a few segments. Right click one of the vertices, click "Remove spline point" or something like that. It shouldn't crash.
Actual behavior
You get a segfault in
mouse.cpp:651
roughly here:Because
r
is 0xccccccccc which I think possibly means uninitialised in MSVC? Anyway it's not pointing to a valid object so it crashes later inr->IndexOfPoint()
.The text was updated successfully, but these errors were encountered: