Open wimalopaan opened 2 years ago
Can you please provide description of the problem? (Please notice, that your code does exactly the same as original: sp==&sd)
There's some discussion on Discord in #dev. But basically, as mentioned the Reset context menu entry is really a delete function, and is currently ineffective.
There's some discussion on Discord in #dev. But basically, as mentioned the Reset context menu entry is really a delete function, and is currently ineffective.
Sounds like we should do something about it.
Can you please provide description of the problem? (Please notice, that your code does exactly the same as original: sp==&sd)
The code I posted above does a different thing as the original (and works as expected). This the capture of the lambda is by-value, the original closure deletes a copy of the ScriptData, which effectively does nothing. The modification passes the pointer (not the to be deleted object) by-value, and therefor really zeroes the array-element.
instead of STR_RESET
it should be STR_DELETE
.
Is incorcoparetd in #1317 now
Maybe #1340 is of interest also.
Can this be closed?
1) the name
Reset
of the entry is misleading, it should readDelete line
2) the closure erases a local copy of the ScriptData because it captures that per value.
https://github.com/EdgeTX/edgetx/blob/d37b3e40518af42b6e54b3bda1b432a8f0431427/radio/src/gui/colorlcd/model_mixer_scripts.cpp#L259-L269
Fix using a pointer copy:
But: I see this pattern all over the place (capture by value), which make me wonder what the reason is, maybe because there are different threads involved?
So, I don't know if a captue by ref would be ok?