diff --git a/include/react/Observer.h b/include/react/Observer.h index 45fd78a1..db690998 100644 --- a/include/react/Observer.h +++ b/include/react/Observer.h @@ -130,6 +130,7 @@ class ScopedObserver ScopedObserver& operator=(ScopedObserver&& other) { obs_ = std::move(other.obs_); + return *this; } // Deleted default ctor, copy ctor and assignment @@ -139,7 +140,8 @@ class ScopedObserver ~ScopedObserver() { - obs_.Detach(); + if (obs_.IsValid()) + obs_.Detach(); } bool IsValid() const diff --git a/include/react/detail/ReactiveBase.h b/include/react/detail/ReactiveBase.h index d7f32124..97d28a24 100644 --- a/include/react/detail/ReactiveBase.h +++ b/include/react/detail/ReactiveBase.h @@ -61,7 +61,7 @@ class ReactiveBase // Move assignment ReactiveBase& operator=(ReactiveBase&& other) { - ptr_.reset(std::move(other)); + ptr_ = std::move(other.ptr_); return *this; } diff --git a/include/react/logging/EventLog.h b/include/react/logging/EventLog.h index e9622c7b..0e87cf05 100644 --- a/include/react/logging/EventLog.h +++ b/include/react/logging/EventLog.h @@ -29,7 +29,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// class EventLog { - using TimestampT = std::chrono::time_point; + using TimestampT = std::chrono::time_point; class Entry {