From 2aceebdf21c77b0f8d135b7f42fbb0f503fddd93 Mon Sep 17 00:00:00 2001 From: goldenhawking Date: Sat, 16 Mar 2024 17:41:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=9A=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=B6=88=E6=81=AF=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskbusplatform/core/taskproject.cpp | 8 +++++++- taskbusplatform/core/taskproject.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/taskbusplatform/core/taskproject.cpp b/taskbusplatform/core/taskproject.cpp index 54ba3ab..bca11a3 100644 --- a/taskbusplatform/core/taskproject.cpp +++ b/taskbusplatform/core/taskproject.cpp @@ -989,8 +989,10 @@ void taskProject::timerEvent(QTimerEvent * evt) void taskProject::push_msg(QString smsg) { + m_mtxMsg.lock(); m_bufferMsgs.push_back(QByteArray::fromStdString(smsg.toStdString())); m_bufferMsgSources.push_back(QString("Project:")); + m_mtxMsg.unlock(); } void taskProject::send_msg(QString smsgSource, QByteArrayList lst) { @@ -1003,20 +1005,24 @@ void taskProject::send_msg(QString smsgSource, QByteArrayList lst) last_ck = curr_ck; const int szMsgs = lst.size(); + m_mtxMsg.lock(); for(int i=0;i #include #include +#include class taskCell; class taskNode; /*! @@ -167,6 +168,7 @@ protected: int m_nTimerID = -1; QByteArrayList m_bufferMsgs; QStringList m_bufferMsgSources; + QMutex m_mtxMsg; void timerEvent(QTimerEvent * evt) override; void push_msg(QString smsg); void send_msg(QString smsgSource, QByteArrayList lst); -- GitLab