| 106 | } |
| 107 | |
| 108 | void 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 | |
| 135 | void processJsonUiPendingUpdates() FL_NOEXCEPT { |
| 136 | // Force immediate processing of any pending UI updates (for testing) |
no test coverage detected