Skip to main content

Practice · 3 of 3

Repair the Dangling Capture

CHALLENGE
Difficulty: advanced+25 XP

This starter's generator captures a local **by reference** and dangles. Repair makeCounter so the state lives inside the coroutine frame (by-value parameter) — the graded check forces a resumption that would read dead memory in the original.

Back to lesson: Practice: Hands on the Handle