FastLED 3.9.15
Loading...
Searching...
No Matches

◆ reset() [1/2]

template<typename T>
void fl::shared_ptr< T >::reset ( )
inlinenoexcept

Definition at line 223 of file shared_ptr.h.

223 {
224 //FASTLED_WARN("shared_ptr::reset() called: ptr_=" << ptr_
225 // << ", control_block_=" << control_block_);
226 if (control_block_) {
227 //FASTLED_WARN("control_block exists, calling remove_shared_ref()");
228 if (control_block_->remove_shared_ref()) {
229 //FASTLED_WARN("control_block_->remove_shared_ref() returned true, destroying object");
230 control_block_->destroy_object();
231 if (--control_block_->weak_count == 0) {
232 //FASTLED_WARN("weak_count reached 0, destroying control block");
233 control_block_->destroy_control_block();
234 }
235 }
236 }
237 ptr_ = nullptr;
238 control_block_ = nullptr;
239 }
detail::ControlBlockBase * control_block_
Definition shared_ptr.h:109

References control_block_, and ptr_.

Referenced by ~shared_ptr(), operator=(), and operator=().

+ Here is the caller graph for this function: