Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Dispose not being called for 3 minutes after browser close when using Firefox + Blazor Server [duplicate]

$
0
0

I am using .net 8 blazor server and I have a razor component that implements IDisposable. My dispose method stops and disposes of some timers that are controlling a singleton service. When using firefox the dispose method takes about 3 minutes to get called after the page is closed (not navigated away from).

`@implements IDisposable`...// Dispose is taking 3 minutes to call after the page is closedpublic void Dispose(){    scannerService.Close();    excitationProbeService.Close();    connectivityTimer.Stop();    connectivityTimer.Dispose();    excitationProbeLoadTimer.Stop();    excitationProbeLoadTimer.Dispose();    _logger.LogInformation("Scan Stopped. Disposed of all resources.");}

On google chrome and edge dispose is called immediately as it should be but when using firefox this is not the case. Is there any workaround for this? Some other way to detect the user has left the page?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>