Fix a bug that voting frame and loot frame could fail if lootTable is received when they are shown.
Fixed by disable them first when the lootTable is received.
I comment out self.frame:SetParent(nil) self.frame = nil in onDisable of votingFrame. Otherwise there is memory leak every time the voting frame is disabled
I have tested and monitored the memory usage to ensure there is no significant memory leak.
Fix an issue if ML reloads during session and start session again, before other raid members haven't finished clicking lootFrame.
Reproduce: Play two characters and put them in a group. Group leader does "/rc test 25" and reload immediately when see the voting frame, then "/rc test 5". The display of the loot frame of the other raid member is unintended.
Fix an unintended code that it's possible that :Trash() fails to remove the entry from self.entries.
Before the fix, it's possible that self.entry has some entry left, after the LootFrame is disabled.
To make tremove(self.entries, entry.position) works, :Update() must be run after every trash, but you didn't run :Update() after each :Trash() in :OnDisable(). I change tremove to tDeleteItem. Now entry.position is only used in debugging code. I don't think it's a good idea to maintain and use such variable, because it's easy to error. It would be better to use some function to fetch it's current position in self.entries.
self.frame:SetParent(nil) self.frame = nil
in onDisable of votingFrame. Otherwise there is memory leak every time the voting frame is disabled