SEBWIN-411: Fixed audio / video playback not stopping when closing additional browser window.
This commit is contained in:
parent
c8b6aad877
commit
48d0dc4db6
3 changed files with 15 additions and 0 deletions
|
@ -109,6 +109,7 @@ namespace SafeExamBrowser.Browser
|
|||
|
||||
internal void Terminate()
|
||||
{
|
||||
control.Destroy();
|
||||
window.Close();
|
||||
}
|
||||
|
||||
|
@ -459,6 +460,7 @@ namespace SafeExamBrowser.Browser
|
|||
private void Window_Closing()
|
||||
{
|
||||
logger.Info($"Instance has terminated.");
|
||||
control.Destroy();
|
||||
Terminated?.Invoke(Id);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,14 @@ namespace SafeExamBrowser.Browser
|
|||
this.requestHandler = requestHandler;
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
AddressChanged += (o, args) => addressChanged?.Invoke(args.Address);
|
||||
|
|
|
@ -51,6 +51,11 @@ namespace SafeExamBrowser.UserInterface.Contracts.Browser
|
|||
/// </summary>
|
||||
event TitleChangedEventHandler TitleChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes the browser control (e.g. stops audio / video playback) and releases all used resources.
|
||||
/// </summary>
|
||||
void Destroy();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the browser control.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in a new issue