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

◆ reset() [1/2]

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

Definition at line 286 of file shared_ptr.h.

286 {
287 //FL_WARN("shared_ptr::reset() called: mPtr=" << mPtr
288 // << ", mControlBlock=" << mControlBlock);
289 if (mControlBlock) {
290 //FL_WARN("control_block exists, calling remove_shared_ref()");
291 if (mControlBlock->remove_shared_ref()) {
292 //FL_WARN("mControlBlock->remove_shared_ref() returned true, destroying object");
293 mControlBlock->destroy_object();
294 if (--mControlBlock->weak_count == 0) {
295 //FL_WARN("weak_count reached 0, destroying control block");
296 mControlBlock->destroy_control_block();
297 }
298 }
299 }
300 mPtr = nullptr;
301 mControlBlock = nullptr;
302 }
detail::ControlBlockBase * mControlBlock
Definition shared_ptr.h:158