Skip to content

Some notification observers are not removed #20994

@crazytonyli

Description

@crazytonyli

There are many places that calls NotificationCenter.addObserver(forName:object:queue:using:) and discards its return value, which leads to the observer not being unregistered.

Observers not getting unregistered will cause some problems:

  1. The block argument will not be released, which causes some objects not being released in some cases.
  2. The observer code is executed at a time that you don't expect them to execute.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions