Skip to content

Commit

Permalink
Disable browserpool
Browse files Browse the repository at this point in the history
Browsers are not being cleaned properly
  • Loading branch information
Python1320 authored Dec 2, 2024
1 parent 3c28ee8 commit 6516b4b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lua/autorun/includes/modules/browserpool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ browserpool.pending = pending
-- Minimum number of active browsers to be pooled.
-- @type Number
--
local numMin = 2
local numMin = 0

---
-- Maximum number of active browsers to be pooled.
Expand All @@ -44,27 +44,27 @@ local numMin = 2
local numMax = 8

function browserpool.setLimits(min,max)
numMin = 2
numMin = min
numMax = max
end

---
-- Number of currently active browsers.
-- @type Number
--
local numActive = 0
local numActive = table.Count(browserpool.active)

---
-- Number of currently pending browser requests.
-- @type Number
--
local numPending = 0
local numPending = table.Count(browserpool.pending)

---
-- Number of total browser requests.
-- @type Number
--
local numRequests = 0
local numRequests = table.Count(browserpool.pending)

---
-- Default URL to set browsers on setup/teardown.
Expand All @@ -88,7 +88,7 @@ local function setupPanel( panel )

-- Create a new panel if it wasn't passed in
if panel then
panel:Stop()
panel:StopLoading()
else
panel = vgui.Create("DMediaPlayerHTML")
end
Expand All @@ -105,7 +105,7 @@ local function setupPanel( panel )
panel:SetPaintedManually(true)

-- Fix for panel not getting cleared after 3/2017 update
panel:SetHTML( "" )
panel:SetHTML( "<b>browserpool: should not see this</b>" )

-- Set default URL
panel:OpenURL( defaultUrl )
Expand Down Expand Up @@ -319,6 +319,9 @@ end)
concommand.Add("browserpool_kill", function()
for k, v in next, browserpool.active do
browserpool.active[k] = nil
v:StopLoading()
v:SetHTML"<b>no</b>"
v:OpenURL(defaultUrl)
v:Remove()
end

Expand Down

0 comments on commit 6516b4b

Please sign in to comment.