Fix memory leak in Nanoleaf Controller
This commit is contained in:
parent
e61b6cd3d7
commit
aeb1e364c4
1 changed files with 5 additions and 1 deletions
|
|
@ -192,6 +192,8 @@ void NanoleafController::UpdateLEDs(std::vector<RGBColor>& colors)
|
|||
}
|
||||
|
||||
external_control_socket.udp_write((char*)message, (size * 7) + 1);
|
||||
|
||||
free(message);
|
||||
}
|
||||
else if((model == NANOLEAF_CANVAS_MODEL)
|
||||
|| (model == NANOLEAF_SHAPES_MODEL))
|
||||
|
|
@ -230,6 +232,8 @@ void NanoleafController::UpdateLEDs(std::vector<RGBColor>& colors)
|
|||
}
|
||||
|
||||
external_control_socket.udp_write((char *)message, (size * 8) + 2);
|
||||
|
||||
free(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +256,7 @@ void NanoleafController::StartExternalControl()
|
|||
|
||||
json response;
|
||||
if((APIRequest("PUT", location, "/api/v1/"+auth_token+"/effects", &request, &response) / 100) == 2)
|
||||
{
|
||||
{
|
||||
external_control_socket.udp_client(response["streamControlIpAddr"].get<std::string>().c_str(), std::to_string(response["streamControlPort"].get<int>()).c_str());
|
||||
|
||||
selectedEffect = NANOLEAF_DIRECT_MODE_EFFECT_NAME;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue