Ticket #7250 (closed bug: fixed)
Documentation of System.Mem.Weak should emphasize finalizers may be run earlier than expected
|Reported by:||edsko||Owned by:||simonmar|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||Blocked By:|
The problem is mentioned in addFinalizer, but not in mkWeak; moreover, the documentation of addFinalizer reads as if this is a problem specific to foreign pointers, which is not (and, unrelated, ForeignPtr?# does not exist anymore).
It would be useful if the problem were highlighted in mkWeak, as it may introduce hard to find bugs in user code in cases where finalizers that are run too early cause problems. The behaviour of mkWeak is highly non-obvious.