Skip to content

fix(core): clone state deep copy#15947

Draft
rc-swag wants to merge 3 commits into
fix/windows/15857/caps-indicator-switched-off-selectfrom
fix/windows/clone-state-deep-copy
Draft

fix(core): clone state deep copy#15947
rc-swag wants to merge 3 commits into
fix/windows/15857/caps-indicator-switched-off-selectfrom
fix/windows/clone-state-deep-copy

Conversation

@rc-swag
Copy link
Copy Markdown
Contributor

@rc-swag rc-swag commented May 12, 2026

The api call km_core_state_clone which uses the copy constructor for the state which performed a shallow copy of _action_struct.
This would cause a free to be called on allready freed memory when disposing of the clone state object.

This change adds adds a deep copy and adds helper functions to actions, and options class.
Adds test assertions verifying that original and cloned states have independent action_struct values.

This commit update the state object to have a deep copy for the
action_struct member. The tests have been modified but have
a few issues however this branch is out of date with the refacted
master branch for unit tests. This commit gets the main change in
a future commit will update the tests.
@github-project-automation github-project-automation Bot moved this to Todo in Keyman May 12, 2026
@keymanapp-test-bot keymanapp-test-bot Bot added the user-test-missing User tests have not yet been defined for the PR label May 12, 2026
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot Bot commented May 12, 2026

User Test Results

Test specification and instructions

ERROR: user tests have not yet been defined

Test Artifacts

  • Developer
    • Keyman Developer - build : all tests passed (no artifacts on BuildLevel "build")
    • Compiler Regression Tests - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman Developer (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • Keyboards
    • Test Keyboards - build : all tests passed (no artifacts on BuildLevel "build")
  • macOS
    • Keyman for macOS - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman for macOS (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • Web
    • KeymanWeb Test Home - build : all tests passed (no artifacts on BuildLevel "build")
  • Windows
    • Keyman for Windows - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for Windows - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for Windows (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman for Windows (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • Text Editor (ARM64) - build : all tests passed (no artifacts on BuildLevel "build")
    • Text Editor (x64) - build : all tests passed (no artifacts on BuildLevel "build")
    • Text Editor (x86) - build : all tests passed (no artifacts on BuildLevel "build")

@keymanapp-test-bot keymanapp-test-bot Bot added this to the A19S29 milestone May 12, 2026
@rc-swag rc-swag changed the base branch from master to fix/windows/15857/caps-indicator-switched-off-select May 12, 2026 08:09
@rc-swag rc-swag changed the title fix(windows): clone state deep copy fix(core): clone state deep copy May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core/ Keyman Core fix user-test-missing User tests have not yet been defined for the PR windows/

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant