Page MenuHomePhabricator

Clean up preference pointer anti pattern
Closed, ResolvedPublic


In many locations like preference pages a copy of the pointer to the preferences is commonly kept, which is explicitly discouraged to do so in the documentation of the preferences.

While the preference service takes measures for ensuring this to be safe, it cannot guarantee that pointers are still valid at the very end of an application when the static components are destructed/uninitialized in an undefined order possibly before the service itself is shut down, leading to a situation where the service is still available but the backend/preferences are already destructed. Currently it is an academic case but there's just no reason to keep storing pointers to the preferences.

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Related Objects