Skip to content

Commit a5a706b

Browse files
committed
- Removed implementation-specific __invalidate method from IObserverHandle because it can be safely statically divined in the implementation of Observable
1 parent bef288d commit a5a706b

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/ESPressio_IObservable.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ namespace ESPressio {
1414
/// It is used to not only check if the `IObservable` still exists, but also to unregister the Observer when desired!
1515
class IObserverHandle {
1616
public:
17-
/// Will null the `IObservable` reference to inform that the Observable is no longer valid
18-
/// Do not call this method directly, it is called by the `IObservable` when it is destroyed
19-
virtual void __invalidate() = 0;
2017
/// Will Unregister this Observer from the `IObservable` if it still exists
2118
virtual void Unregister() = 0;
2219
/// Will return a `weak_ptr` to the `IObservable`

src/ESPressio_Observable.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace ESPressio {
3434
public:
3535
~Observable() {
3636
for (auto observer : _observers) {
37-
observer->__invalidate();
37+
static_cast<ObserverHandle*>(observer)->__invalidate();
3838
}
3939
}
4040

0 commit comments

Comments
 (0)