MCPcopy Create free account
hub / github.com/AGenUI/AGenUI / init

Method init

core/src/module/agenui_surface_manager.cpp:39–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool SurfaceManager::init() {
40 AGENUI_LOG("init, %d", _instanceId);
41 // Create EventDispatcher and flush cached listeners under the same lock
42 // to prevent race with addSurfaceEventListener/removeSurfaceEventListener
43 {
44 std::lock_guard<std::mutex> mutexWrap(_cachedListenersMutex);
45 _dispatcher = new EventDispatcher();
46 for (const auto &listener : _cachedListeners) {
47 AGENUI_LOG("add cached listener %p", listener);
48 _dispatcher->addEventListener(listener);
49 }
50 _cachedListeners.clear();
51 }
52
53 // Create modules in dependency order
54 createSurfaceCoordinator();
55 createStreamingContentParser();
56 return true;
57}
58
59void SurfaceManager::uninit() {
60 AGENUI_LOG("uninit, %d", _instanceId);

Callers 1

createSurfaceManagerMethod · 0.45

Calls 2

addEventListenerMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected