Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.7k stars 886 forks source link

Fix possible crash #2120

Closed wawanbreton closed 4 months ago

wawanbreton commented 4 months ago

To compute the end type, we previously used a lambda function, that was declared static. Thus, the arguments were apparently captured when calling it the first time, and didn't change for subsequent calls. As one of them is a pointer, this could crash if the pointed object had been destroyed in the meantime.

Although the minimum fix is just to remove the static for the function, I removed the function itself because it really doesn't make sense anymore in this context.

CURA-12042