spiegel-keyman/core/tests/unit
Marc Durdin 7ec4832edc fix(core): memory management of options in action struct
Fixes #10067.

Management of memory for persisted options was wrong in the action
struct, as the members key and value would be freed immediately after
being added to the temporary vector (because the vector was of the
struct rather than of the class).

Given the struct is a C struct, we need the memory management to be
explicit, so we now release() each option into the vector as we create
it, which means that its member values will not be freed when the option
is then immediately deleted. (This allows us to use the initial copy of
the members of option that option() constructor does.)

Added the release() function as that was a relatively clear way of
indicating that the contents of the structure are now owned by the
caller, following the pattern from std::unique_ptr.

Finally, the unit test for persisted options was in the action_api.cpp
test module, but it was never called, so this was not being tested. Now
it is.
2023-11-24 07:52:31 +10:00
..
json chore(core): split flags into standard.meson.build 2023-03-09 11:34:54 +07:00
kmnkbd fix(core): memory management of options in action struct 2023-11-24 07:52:31 +10:00
kmx chore(linux): Rename namespace kbp to core 2023-10-19 10:39:55 +02:00
ldml Merge branch 'fix/developer/9438-vis-kbd-crash-epic-ldml' into fix/core-9961-optional-startContext-epic-ldml 2023-11-21 18:23:04 -06:00
utftest chore(common): Merge branch 'chore/web/keyman-version-for-developer' into chore/common/move-common-core-desktop-to-core 2022-05-30 09:38:27 +10:00
emscripten_filesystem.cpp feat(core): use kmc to build kmx tests 2023-03-24 06:22:40 +07:00
emscripten_filesystem.h feat(core): use kmc to build kmx tests 2023-03-24 06:22:40 +07:00
meson.build chore(core): make kmx_test_source available as a library 2023-02-23 15:50:58 +07:00