MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / close

Method close

Examples/SCExample/HotReloadSystem.h:110–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 }
109
110 Result close()
111 {
112 Result result(true);
113 auto preserveFirstError = [&result](Result closeResult)
114 {
115 if (not closeResult and result)
116 {
117 result = closeResult;
118 }
119 };
120
121 preserveFirstError(fileSystemWatcher.close());
122 if (eventLoop)
123 {
124 for (size_t idx = 0; idx < registry.getNumberOfEntries(); ++idx)
125 {
126 const PluginDynamicLibrary& library = registry.getPluginDynamicLibraryAt(idx);
127 ISCExample* example = nullptr;
128 if (library.queryInterface(example) and example->closeAsync.isValid())
129 {
130 preserveFirstError(example->closeAsync(*eventLoop));
131 }
132 }
133 }
134 eventLoop = nullptr;
135 preserveFirstError(registry.close());
136 return result;
137 }
138
139 Result syncRegistry()
140 {

Callers

nothing calls this directly

Calls 4

getNumberOfEntriesMethod · 0.80
queryInterfaceMethod · 0.80
isValidMethod · 0.45
closeAsyncMethod · 0.45

Tested by

no test coverage detected