MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / onStop

Method onStop

Tactility/Source/service/gui/GuiService.cpp:202–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void GuiService::onStop(ServiceContext& service) {
203 lvgl::stopUsbHidInput();
204
205 lock();
206
207 const auto loader = findLoaderService();
208 assert(loader != nullptr);
209 loader->getPubsub()->unsubscribe(loader_pubsub_subscription);
210
211 appToRender = nullptr;
212 isStarted = false;
213
214 threadFlags.set(GUI_THREAD_FLAG_EXIT);
215 unlock();
216 thread->join();
217
218 if (lvgl::lock()) {
219 if (keyboardGroup != nullptr) {
220 lv_group_delete(keyboardGroup);
221 keyboardGroup = nullptr;
222 }
223 lvgl::unlock();
224 } else {
225 LOGGER.error("Failed to lock LVGL during GUI stop");
226 }
227
228 delete thread;
229}
230
231void GuiService::requestDraw() {
232 threadFlags.set(GUI_THREAD_FLAG_DRAW);

Callers

nothing calls this directly

Calls 9

findLoaderServiceFunction · 0.85
unsubscribeMethod · 0.80
setMethod · 0.80
joinMethod · 0.80
errorMethod · 0.80
stopUsbHidInputFunction · 0.50
lockFunction · 0.50
unlockFunction · 0.50
getPubsubMethod · 0.45

Tested by

no test coverage detected