Skip to content

Call Future cancellation in the object finalizer #17

@DragonFrai

Description

@DragonFrai

Problem

The absence of a Drop call for non-terminal futures can lead to memory leaks or infinite waiting for mutexes and other synchronization primitives in case of an exception.

Solution

Call Future cancellation in the object finalizer and suppress the finalization when completed correctly

Alternatives

Do nothing.
The low-level implementation of Future is responsible for the correct Drop call, and the user should not be able to cause these errors by any of his actions.
Exceptions are the explicit acquisition of resources similar to locks, as in Mutex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    futuresAssigned with futures module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions