forked from xiaozhi/xiaozhi-esp32
remove unnecessary mutex (use Schedule)
This commit is contained in:
@@ -373,8 +373,6 @@ void Application::AbortSpeaking() {
|
|||||||
cJSON* root = cJSON_CreateObject();
|
cJSON* root = cJSON_CreateObject();
|
||||||
cJSON_AddStringToObject(root, "type", "abort");
|
cJSON_AddStringToObject(root, "type", "abort");
|
||||||
char* json = cJSON_PrintUnformatted(root);
|
char* json = cJSON_PrintUnformatted(root);
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
|
||||||
ws_client_->Send(json);
|
ws_client_->Send(json);
|
||||||
cJSON_Delete(root);
|
cJSON_Delete(root);
|
||||||
free(json);
|
free(json);
|
||||||
@@ -435,8 +433,6 @@ void Application::SetChatState(ChatState state) {
|
|||||||
cJSON_AddStringToObject(root, "type", "state");
|
cJSON_AddStringToObject(root, "type", "state");
|
||||||
cJSON_AddStringToObject(root, "state", state_str[chat_state_]);
|
cJSON_AddStringToObject(root, "state", state_str[chat_state_]);
|
||||||
char* json = cJSON_PrintUnformatted(root);
|
char* json = cJSON_PrintUnformatted(root);
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
|
||||||
ws_client_->Send(json);
|
ws_client_->Send(json);
|
||||||
cJSON_Delete(root);
|
cJSON_Delete(root);
|
||||||
free(json);
|
free(json);
|
||||||
|
|||||||
Reference in New Issue
Block a user