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

Method UnregisterNetworkClient

ResourceManager.cpp:591–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591void ResourceManager::UnregisterNetworkClient(NetworkClient* network_client)
592{
593 /*-------------------------------------------------------------------------*\
594 | Stop the disconnecting client |
595 \*-------------------------------------------------------------------------*/
596 network_client->StopClient();
597
598 /*-------------------------------------------------------------------------*\
599 | Clear callbacks from the client before removal |
600 \*-------------------------------------------------------------------------*/
601 network_client->ClearCallbacks();
602
603 /*-------------------------------------------------------------------------*\
604 | Find the client to remove and remove it from the clients list |
605 \*-------------------------------------------------------------------------*/
606 std::vector<NetworkClient*>::iterator client_it = std::find(clients.begin(), clients.end(), network_client);
607
608 if(client_it != clients.end())
609 {
610 clients.erase(client_it);
611 }
612
613 /*-------------------------------------------------------------------------*\
614 | Delete the client |
615 \*-------------------------------------------------------------------------*/
616 delete network_client;
617
618 UpdateDeviceList();
619}
620
621std::vector<NetworkClient*>& ResourceManager::GetClients()
622{

Callers 1

Calls 6

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

Tested by

no test coverage detected