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 |
|---|---|---|---|
| Priority: | high | Milestone: | 7.6.2 |
| Component: | Documentation | Version: | 7.6.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
