Skip to content

Commit 6d4f7e9

Browse files
authored
Fix Page._workers concurrency issues (#1696)
1 parent 02c0599 commit 6d4f7e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/PuppeteerSharp/Page.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class Page : IDisposable, IAsyncDisposable
4040
private readonly TaskQueue _screenshotTaskQueue;
4141
private readonly EmulationManager _emulationManager;
4242
private readonly Dictionary<string, Delegate> _pageBindings;
43-
private readonly Dictionary<string, Worker> _workers;
43+
private readonly IDictionary<string, Worker> _workers;
4444
private readonly ILogger _logger;
4545
private PageGetLayoutMetricsResponse _burstModeMetrics;
4646
private bool _screenshotBurstModeOn;
@@ -74,7 +74,7 @@ private Page(
7474
_timeoutSettings = new TimeoutSettings();
7575
_emulationManager = new EmulationManager(client);
7676
_pageBindings = new Dictionary<string, Delegate>();
77-
_workers = new Dictionary<string, Worker>();
77+
_workers = new ConcurrentDictionary<string, Worker>();
7878
_logger = Client.Connection.LoggerFactory.CreateLogger<Page>();
7979
Accessibility = new Accessibility(client);
8080

0 commit comments

Comments
 (0)