Skip to content

Commit

Permalink
fixed segfault by adding _chatLogic->SetChatbotHandle(this)
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-vladimir committed Jan 31, 2025
1 parent e13bf39 commit ed7c6a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/chatbot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ChatBot::ChatBot(ChatBot &&source)
_chatLogic = source._chatLogic;
_rootNode = source._rootNode;
_currentNode = source._currentNode;

_chatLogic->SetChatbotHandle(this);
source._image = nullptr;
source._chatLogic = nullptr;
source._rootNode = nullptr;
Expand All @@ -93,9 +93,13 @@ ChatBot &ChatBot::operator=(ChatBot &&source)
_chatLogic = source._chatLogic;
_rootNode = source._rootNode;
_currentNode = source._currentNode;
_chatLogic->SetChatbotHandle(this);
source._image = nullptr;
source._chatLogic = nullptr;
source._rootNode = nullptr;
source._currentNode = nullptr;
return *this;
}
////
//// EOF STUDENT CODE

void ChatBot::ReceiveMessageFromUser(std::string message)
Expand Down

0 comments on commit ed7c6a7

Please sign in to comment.