Skip to content

Commit

Permalink
Fix Trader memoryleak caused by OnFrame functions (#5473)
Browse files Browse the repository at this point in the history
* fix(pobtrader): memoryleak caused by unsubbed OnFrame functions

* style(pobtrader): fix indentation
  • Loading branch information
Dullson authored Dec 28, 2022
1 parent bfc5eb8 commit cdd6fe2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/Classes/TradeQuery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ local TradeQueryClass = newClass("TradeQuery", function(self, itemsTab)
self.pbLeagueIndex = 1

self.tradeQueryRequests = new("TradeQueryRequests", self)
table.insert(main.onFrameFuncs, function()
main.onFrameFuncs["TradeQueryRequests"] = function()
self.tradeQueryRequests:ProcessQueue()
end)
end

-- set
self.storedGlobalCacheDPSView = GlobalCache.useFullDPS
Expand Down Expand Up @@ -185,7 +185,9 @@ end
-- Opens the item pricing popup
function TradeQueryClass:PriceItem()
self.tradeQueryGenerator = new("TradeQueryGenerator", self)

main.onFrameFuncs["TradeQueryGenerator"] = function()
self.tradeQueryGenerator:OnFrame()
end
-- Count number of rows to render
local row_count = 3 + #baseSlots
-- Count sockets
Expand Down
3 changes: 0 additions & 3 deletions src/Classes/TradeQueryGenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ local TradeQueryGeneratorClass = newClass("TradeQueryGenerator", function(self,
self.itemsTab = queryTab.itemsTab
self.calcContext = { }

table.insert(main.onFrameFuncs, function()
self:OnFrame()
end)
end)

local function fetchStats()
Expand Down

0 comments on commit cdd6fe2

Please sign in to comment.