@@ -46,10 +46,10 @@ namespace ESPressio {
4646 // Members
4747 T _value;
4848 std::mutex _mutex;
49- std::function<void (T,T)>* _onChange = nullptr ;
49+ std::function<void (T,T)> _onChange = nullptr ;
5050 public:
5151 // Constructor/Destructor
52- Mutex (T value, std::function<void (T,T)>* onChange = nullptr ) : _value(value), _onChange((onChange)) { }
52+ Mutex (T value, std::function<void (T,T)> onChange = nullptr ) : _value(value), _onChange((onChange)) { }
5353 // Methods
5454 T Get () {
5555 std::lock_guard<std::mutex> lock (_mutex);
@@ -67,7 +67,7 @@ namespace ESPressio {
6767 }
6868
6969 // / Returns the OnChange Callback for the `Mutex` object.
70- std::function<void (T,T)>* GetOnChange () {
70+ std::function<void (T,T)> GetOnChange () {
7171 std::lock_guard<std::mutex> lock (_mutex);
7272 return _onChange;
7373 }
@@ -77,7 +77,7 @@ namespace ESPressio {
7777 T oldValue = _value;
7878 if (oldValue == value) { return ; }
7979 _value = value;
80- if (_onChange != nullptr ) { (* _onChange)(oldValue, value); }
80+ if (_onChange != nullptr ) { (_onChange)(oldValue, value); }
8181 }
8282
8383 // / Returns a boolean notifying you if the value was set successfully (assuming that the thread-safe lock was available at the point of request).
@@ -147,10 +147,10 @@ namespace ESPressio {
147147 // Members
148148 T _value;
149149 std::shared_mutex _mutex;
150- std::function<void (T,T)>* _onChange = nullptr ;
150+ std::function<void (T,T)> _onChange = nullptr ;
151151 public:
152152 // Constructor/Destructor
153- ReadWriteMutex (T value, std::function<void (T,T)>* onChange = nullptr ) : _value(value), _onChange((onChange)) { }
153+ ReadWriteMutex (T value, std::function<void (T,T)> onChange = nullptr ) : _value(value), _onChange((onChange)) { }
154154 // Methods
155155 T Get () {
156156 std::shared_lock<std::shared_mutex> lock (_mutex);
@@ -168,7 +168,7 @@ namespace ESPressio {
168168 }
169169
170170 // / Returns the OnChange Callback for the `ReadWriteMutex` object.
171- std::function<void (T,T)>* GetOnChange () {
171+ std::function<void (T,T)> GetOnChange () {
172172 std::shared_lock<std::shared_mutex> lock (_mutex);
173173 return _onChange;
174174 }
@@ -178,7 +178,7 @@ namespace ESPressio {
178178 T oldValue = _value;
179179 if (oldValue == value) { return ; }
180180 _value = value;
181- if (_onChange != nullptr ) { (* _onChange)(oldValue, value); }
181+ if (_onChange != nullptr ) { (_onChange)(oldValue, value); }
182182 }
183183
184184 // / Returns a boolean notifying you if the value was set successfully (assuming that the thread-safe lock was available at the point of request).
0 commit comments