fixed mem leak in p3MsgService

This commit is contained in:
csoler 2021-01-07 18:31:46 +01:00
parent 672f2d1252
commit 78628a1842
2 changed files with 14 additions and 0 deletions

View File

@ -115,6 +115,19 @@ RsServiceInfo p3MsgService::getServiceInfo()
MSG_MIN_MINOR_VERSION);
}
p3MsgService::~p3MsgService()
{
RS_STACK_MUTEX(mMsgMtx); /********** STACK LOCKED MTX ******/
for(auto tag:mTags) delete tag.second;
for(auto tag:mMsgTags) delete tag.second;
for(auto msgid:mSrcIds) delete msgid.second;
for(auto parentid:mParentId) delete parentid.second;
for(auto img:imsg) delete img.second;
for(auto mout:msgOutgoing) delete mout.second;
for(auto mpend:_pendingPartialMessages) delete mpend.second;
}
uint32_t p3MsgService::getNewUniqueMsgId()
{

View File

@ -56,6 +56,7 @@ class p3MsgService :
{
public:
p3MsgService(p3ServiceControl *sc, p3IdService *id_service, p3GxsTrans& gxsMS);
virtual ~p3MsgService();
virtual RsServiceInfo getServiceInfo();