Fix segfault in Remove Spline Point context menu
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 commit is contained in:
parent
f7b6f6930e
commit
485fd012b4
@ -647,7 +647,7 @@ void GraphicsWindow::MouseRightUp(double x, double y) {
|
|||||||
int index = r->IndexOfPoint(gs.point[0]);
|
int index = r->IndexOfPoint(gs.point[0]);
|
||||||
if((r->type == Request::Type::CUBIC && (index > 1 && index < r->extraPoints + 2)) ||
|
if((r->type == Request::Type::CUBIC && (index > 1 && index < r->extraPoints + 2)) ||
|
||||||
r->type == Request::Type::CUBIC_PERIODIC) {
|
r->type == Request::Type::CUBIC_PERIODIC) {
|
||||||
menu->AddItem(_("Remove Spline Point"), [&]() {
|
menu->AddItem(_("Remove Spline Point"), [this, r]() {
|
||||||
int index = r->IndexOfPoint(gs.point[0]);
|
int index = r->IndexOfPoint(gs.point[0]);
|
||||||
ssassert(r->extraPoints != 0,
|
ssassert(r->extraPoints != 0,
|
||||||
"Expected a bezier with interior control points");
|
"Expected a bezier with interior control points");
|
||||||
|
Loading…
Reference in New Issue
Block a user