Core/Group: Fix memory leak upon group disband.#22955
Conversation
Disbanding the group called RollId.clear(); which prevented roll deletion in group destructor. Proposed fix ends all rolls prematurely during group disband - distributing the items and deleting the rolls.
|
Need to confirm the leak but this solution opens up "start roll and immediately disband for guaranteed loot" exploits |
|
Yes, it would. However, I don't believe (guessing) this would make any difference between this or disbanding the group right before kill. Actually, I'm not sure how this was handled on retail, but it seems to be the most rational thing to do - distribute the loot among participants and consider the rest as if they passed. |
|
Does disband happen only when everyone leaves ? Otherwise maybe don't allow to disband manually if there is a roll going on ? |
|
not blizzlike, on retail people can leave while a roll is on. |
|
Leak Sanitizer report
|
|
what about removing the line "RollId.clear();" and letting ~Group() delete the roll ? Until the loot is distributed blizzlike |
|
f04e90f fixes the memory leak, blizzlike behavior still needs to be implemented properly though |
|
maybe those rolls could be put in a worldwide container and updated every loop ? |
|
sound like the best approach |
Disbanding the group called RollId.clear(); which prevented roll deletion in group destructor, causing the rolls to leak.
Proposed fix ends all rolls prematurely during group disband - distributing related items and deleting the rolls.
Changes proposed:
Target branch(es): 3.3.5/master
Tests performed: (Does it build, tested in-game, etc.)
Not tested, not built
Known issues and TODO list: (add/remove lines as needed)
None