Skip to content

Commit

Permalink
Issue8: added deleted PublishMessage un PublishMessageAction to avoid…
Browse files Browse the repository at this point in the history
… memory leak
  • Loading branch information
alexCajas committed Nov 6, 2023
1 parent 70c596b commit 4178aab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Actions/PublishAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ PublishAction::PublishAction(MqttClient* mqttClient, ReaderMqttPacket packetRead
publishMqttMessage = new PublishMqttMessage(packetReaded);
}

PublishAction::~PublishAction(){
delete publishMqttMessage;
}


void PublishAction::doAction(){
mqttClient->notifyPublishRecived(publishMqttMessage);
}
2 changes: 1 addition & 1 deletion src/MqttBroker/MqttBroker.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class PublishAction: public Action{
* PublishMqttMessage object.
*/
PublishAction(MqttClient* mqttClient, ReaderMqttPacket packetReaded);

~PublishAction();
/**
* @brief Notify to Broker class a publish mqtt request
* recevided from this client.
Expand Down

0 comments on commit 4178aab

Please sign in to comment.