MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / UnregisterRGBController

Method UnregisterRGBController

ResourceManager.cpp:193–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void ResourceManager::UnregisterRGBController(RGBController* rgb_controller)
194{
195 LOG_INFO("[%s] Unregistering RGB controller", rgb_controller->name.c_str());
196
197 /*-------------------------------------------------------------------------*\
198 | Clear callbacks from the controller before removal |
199 \*-------------------------------------------------------------------------*/
200 rgb_controller->ClearCallbacks();
201
202 /*-------------------------------------------------------------------------*\
203 | Find the controller to remove and remove it from the hardware list |
204 \*-------------------------------------------------------------------------*/
205 std::vector<RGBController*>::iterator hw_it = std::find(rgb_controllers_hw.begin(), rgb_controllers_hw.end(), rgb_controller);
206
207 if (hw_it != rgb_controllers_hw.end())
208 {
209 rgb_controllers_hw.erase(hw_it);
210 }
211
212 /*-------------------------------------------------------------------------*\
213 | Find the controller to remove and remove it from the master list |
214 \*-------------------------------------------------------------------------*/
215 std::vector<RGBController*>::iterator rgb_it = std::find(rgb_controllers.begin(), rgb_controllers.end(), rgb_controller);
216
217 if (rgb_it != rgb_controllers.end())
218 {
219 rgb_controllers.erase(rgb_it);
220 }
221
222 UpdateDeviceList();
223}
224
225std::vector<RGBController*> & ResourceManager::GetRGBControllers()
226{

Callers

nothing calls this directly

Calls 5

findFunction · 0.50
ClearCallbacksMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected