MCPcopy Create free account
hub / github.com/FastLED/FastLED / removeJsonUiComponent

Function removeJsonUiComponent

src/platforms/shared/ui/json/ui.cpp.hpp:108–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void removeJsonUiComponent(fl::weak_ptr<JsonUiInternal> component) FL_NOEXCEPT {
109 // Check if we have an internal manager first
110 // No longer need to clear functions as we're not using lambda captures anymore
111
112 auto& manager = getInternalManager();
113 if (manager) {
114 manager->removeComponent(component);
115 return;
116 }
117
118 // No manager exists, try to remove from pending list
119 auto& pending = getPendingComponents();
120 auto it = pending.find_if([&component](const fl::weak_ptr<JsonUiInternal>& pending_component) FL_NOEXCEPT {
121 // Compare the weak_ptrs by checking if they refer to the same object
122 auto comp_locked = component.lock();
123 auto pending_locked = pending_component.lock();
124 return comp_locked && pending_locked && comp_locked == pending_locked;
125 });
126
127 if (it != pending.end()) {
128 pending.erase(it);
129 // FL_WARN("Removed component from pending list: " << component);
130 } else {
131 // FL_WARN("removeJsonUiComponent: no manager exists and component not in pending list: " << component);
132 }
133}
134
135void processJsonUiPendingUpdates() FL_NOEXCEPT {
136 // Force immediate processing of any pending UI updates (for testing)

Callers 11

~WasmAudioImplMethod · 0.85
~JsonNumberFieldImplMethod · 0.85
~JsonButtonImplMethod · 0.85
~JsonDescriptionImplMethod · 0.85
~JsonCheckboxImplMethod · 0.85
~JsonDropdownImplMethod · 0.85
~JsonAudioImplMethod · 0.85
~JsonSliderImplMethod · 0.85
~JsonTitleImplMethod · 0.85
~JsonHelpImplMethod · 0.85
FL_TEST_FILEFunction · 0.85

Calls 4

removeComponentMethod · 0.80
lockMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected