Skip to content

Allow using Features as globals #13

@clarisma

Description

@clarisma

Because of the indeterminate static initialization order in C++, it is currently not safe to use Features as global variables.

Features relies on a a global hashmap in order to ensure that only one FeatureStore per process is opened for any given GOL. When a global Features object is destroyed, its associated FeatureStore is removed from this hashmap. However, since destruction order of globals is indeterminate, this hashmap may already have been destroyed, resulting in a crash.

To avoid this, we would need to wrap the hashmap in a class that maintains an "alive" flag (set to true by constructor, cleared by destructor). Once that flag is cleared, the hashmap must no longer be accessed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    todoA feature that has been specified, but not yet implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions