spiegel-keyman/core
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
..
doc Merge pull request #9736 from keymanapp/chore/merge-master-into-package-metadata 2023-10-11 11:28:07 +11:00
include Merge branch 'master' into chore/developer/9838-cldr44-epic-ldml 2023-10-26 18:38:14 -05:00
src fix(core): memory management of options in action struct 2023-11-24 07:52:31 +10:00
subprojects Merge branch 'feature-macos-core' into feature/core/add-core-wrapper 2023-10-26 08:41:09 +07:00
tests fix(core): memory management of options in action struct 2023-11-24 07:52:31 +10:00
tools/ldml-const-builder chore(linux): rename keyboardprocessor_ldml.* to keyman_core_ldml 2023-10-20 17:30:10 +02:00
.build-builder chore(core): add core/.build-builder as CI signal 2022-09-12 10:06:29 +10:00
.gitignore chore(core): split flags into standard.meson.build 2023-03-09 11:34:54 +07:00
build.bat chore: move from vcvarsall.bat to vsdevcmd.bat 2023-02-22 09:43:17 +07:00
build.sh fix(common): dx: don't call exit(0) on failure 🙀 2023-11-14 07:16:32 -06:00
commands.inc.sh fix(core): build: support -t parameter correctly 2023-10-22 07:16:52 +07:00
CORE_API_VERSION.md chore(linux): Add Core API version number 2023-10-26 17:16:06 +02:00
cross-mac-arm64.build feat(core): ldml repertoire test 🙀 2023-03-15 18:50:16 -05:00
cross-mac-x86_64.build feat(core): ldml repertoire test 🙀 2023-03-15 18:50:16 -05:00
getversion.bat chore(common): adjust scripts for core relocation 2022-05-18 07:22:11 +10:00
getversion.sh chore(linux): Refactor scripts and packaging 2023-02-14 09:42:13 +01:00
meson.build chore(linux): Add Core API version number 2023-10-26 17:16:06 +02:00
meson_options.txt chore(core): cleanup meson build 2023-02-21 12:12:28 +07:00
wasm.build.linux.in refactor(core): consolidate wasm defs 2023-03-10 13:50:24 +07:00
wasm.build.mac.in refactor(core): consolidate wasm defs 2023-03-10 13:50:24 +07:00
wasm.build.win.in refactor(core): consolidate wasm defs 2023-03-10 13:50:24 +07:00
wasm.defs.build refactor(core): consolidate wasm defs 2023-03-10 13:50:24 +07:00