Skip to content

Tags: leftibot/ChaiScript

Tags

wasm-latest

Toggle wasm-latest's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix ChaiScript#655: Async issues with threads outliving the chaiscrip…

…t engine (ChaiScript#656)

* Fix ChaiScript#655: Join async threads before engine destruction to prevent heap-use-after-free

Issues ChaiScript#632 and ChaiScript#636 (PRs ChaiScript#651 and ChaiScript#653) both stem from the same root cause: async
threads spawned via async() can outlive the Dispatch_Engine, accessing shared state
(global objects map, type maps) after it has been destroyed. The fix moves async()
registration from the stdlib module into ChaiScript_Basic, where spawned threads are
tracked via Dispatch_Engine. The engine's destructor now joins all outstanding async
threads before destroying shared data structures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review: follow rule of 5, explicitly default move operations

Requested by @lefticus in PR ChaiScript#656 review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: leftibot <leftibot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

v6.1.0

Toggle v6.1.0's commit message
Fix lifetime of objects in ranged for loops

Currently this is going to incur a performance cost, but it's correct.

It may need to be reevaluated.

Closes ChaiScript#392

v6.0.0

Toggle v6.0.0's commit message
Merge branch 'develop' of github.com:ChaiScript/ChaiScript into develop

v5.8.6

Toggle v5.8.6's commit message
Update release notes

v5.8.5

Toggle v5.8.5's commit message
Update release notes for 5.8.5

v5.8.4

Toggle v5.8.4's commit message
Increment to 5.8.4

v5.8.3

Toggle v5.8.3's commit message
Add support for *& return types

v5.8.2

Toggle v5.8.2's commit message
Update to 5.8.2 release notes

v5.8.1

Toggle v5.8.1's commit message
Move debug over to windows build

v5.8.0

Toggle v5.8.0's commit message
Update release notes and prepare for 5.8.0