Skip to content

Commit

Permalink
collectGarbage on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Sep 20, 2023
1 parent 2c79115 commit f96aa56
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7383,6 +7383,8 @@ void Game::shutdown() {

ConnectionManager::getInstance().closeAll();

g_luaEnvironment().collectGarbage();

g_logger().info("Done!");
}

Expand Down Expand Up @@ -8402,7 +8404,6 @@ void Game::playerCancelMarketOffer(uint32_t playerId, uint32_t timestamp, uint16
int32_t stackCount = std::min<int32_t>(it.stackSize, tmpAmount);
std::shared_ptr<Item> item = Item::CreateItem(it.id, stackCount);
if (internalAddItem(player->getInbox(), item, INDEX_WHEREEVER, FLAG_NOLIMIT) != RETURNVALUE_NOERROR) {

break;
}

Expand All @@ -8423,7 +8424,6 @@ void Game::playerCancelMarketOffer(uint32_t playerId, uint32_t timestamp, uint16
for (uint16_t i = 0; i < offer.amount; ++i) {
std::shared_ptr<Item> item = Item::CreateItem(it.id, subType);
if (internalAddItem(player->getInbox(), item, INDEX_WHEREEVER, FLAG_NOLIMIT) != RETURNVALUE_NOERROR) {

break;
}

Expand Down Expand Up @@ -8496,7 +8496,6 @@ void Game::playerAcceptMarketOffer(uint32_t playerId, uint32_t timestamp, uint16
if (!buyerPlayer) {
buyerPlayer = std::make_shared<Player>(nullptr);
if (!IOLoginData::loadPlayerById(buyerPlayer, offer.playerId)) {

offerStatus << "Failed to load buyer player " << player->getName();
return;
}
Expand Down

0 comments on commit f96aa56

Please sign in to comment.