Skip to content

Commit

Permalink
fix(NotificationCenter): disable and clear observers in dtor (#4307)
Browse files Browse the repository at this point in the history
  • Loading branch information
matejk committed Dec 9, 2023
1 parent 2dc108d commit 9e8f0ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Foundation/src/NotificationCenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ NotificationCenter::~NotificationCenter()
try
{
Mutex::ScopedLock lock(_mutex);
for (auto& o: _observers)
o->disable();

_observers.clear();
}
catch(...)
{
Expand Down

0 comments on commit 9e8f0ad

Please sign in to comment.