void UnsubscribeAllTypes(mc_client_h handle_, const std::string& server_name) {
int ret;
- for (auto type : types::MediaControllerSubscriptionTypeEnum) {
+ for (auto& type : types::MediaControllerSubscriptionTypeEnum) {
ret = mc_client_unsubscribe(handle_, type.second, server_name.c_str());
if (MEDIA_CONTROLLER_ERROR_NONE != ret) {
LoggerE("mc_client_unsubscribe() failed with type %s, error: %d, message: %s",
// we have to unsubscribe all servers before unsetting callback to avoid
// calling callback twice if the callback will be set again
- for (auto srv : subscribed_servers) {
+ for (auto& srv : subscribed_servers) {
UnsubscribeAllTypes(handle_, srv);
}
subscribed_servers.clear();
SCOPE_EXIT {
if (to_unsubscribe > 0) {
- for (auto type : types::MediaControllerSubscriptionTypeEnum) {
+ for (auto& type : types::MediaControllerSubscriptionTypeEnum) {
if (to_unsubscribe > 0) {
ret = mc_client_unsubscribe(handle_, type.second, server_name.c_str());
if (MEDIA_CONTROLLER_ERROR_NONE != ret) {
}
};
- for (auto type : types::MediaControllerSubscriptionTypeEnum) {
+ for (auto& type : types::MediaControllerSubscriptionTypeEnum) {
ret = mc_client_subscribe(handle_, type.second, server_name.c_str());
if (MEDIA_CONTROLLER_ERROR_NONE != ret) {
return LogAndCreateResult(