← board

Finalize managed values on exception unwind

Motivation

Managed locals (refcounted AnsiString, dynamic arrays) are finalized on normal scope exit, but not on the exception unwind path. Leaks/incorrect refcounts when an exception crosses a scope holding managed values. Blocks making managed strings the default.

Scope

Acceptance

A test that raises through a scope owning managed strings/arrays shows correct release (no leak, no double-free); self-host fixedpoint holds.

Log