removed memory leak in handlign of old chat lobby items

This commit is contained in:
csoler 2018-11-06 20:38:35 +01:00
parent b54305d508
commit f976e1c525
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -1292,15 +1292,15 @@ void DistributedChatService::handleRecvLobbyInvite_Deprecated(RsChatLobbyInviteI
#ifdef DEBUG_CHAT_LOBBIES
std::cerr << "Received deprecated invite to lobby from " << item->PeerId() << " to lobby " << std::hex << item->lobby_id << std::dec << ", named " << item->lobby_name << item->lobby_topic << std::endl;
#endif
RsChatLobbyInviteItem* newItem = new RsChatLobbyInviteItem();
RsChatLobbyInviteItem newItem ;
newItem->lobby_id = item->lobby_id ;
newItem->lobby_name = item->lobby_name ;
newItem->lobby_topic = item->lobby_topic ;
newItem->lobby_flags = item->lobby_flags ;
newItem->PeerId( item->PeerId() );
newItem.lobby_id = item->lobby_id ;
newItem.lobby_name = item->lobby_name ;
newItem.lobby_topic = item->lobby_topic ;
newItem.lobby_flags = item->lobby_flags ;
newItem.PeerId( item->PeerId() );
handleRecvLobbyInvite(newItem);
handleRecvLobbyInvite(&newItem); // The item is not deleted inside this function.
}
void DistributedChatService::handleRecvLobbyInvite(RsChatLobbyInviteItem *item)