mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-08 10:10:00 +00:00
Destroy context after OnHandleDestroyed to allow cleanup
This commit is contained in:
parent
339f184013
commit
f145745b25
|
@ -226,6 +226,10 @@ namespace OpenTK
|
||||||
/// <param name="e">Not used.</param>
|
/// <param name="e">Not used.</param>
|
||||||
protected override void OnHandleDestroyed(EventArgs e)
|
protected override void OnHandleDestroyed(EventArgs e)
|
||||||
{
|
{
|
||||||
|
// Ensure that context is still alive when passing to events
|
||||||
|
// => This allows to perform cleanup operations in OnHandleDestroyed handlers
|
||||||
|
base.OnHandleDestroyed(e);
|
||||||
|
|
||||||
if (context != null)
|
if (context != null)
|
||||||
{
|
{
|
||||||
context.Dispose();
|
context.Dispose();
|
||||||
|
@ -238,7 +242,6 @@ namespace OpenTK
|
||||||
implementation = null;
|
implementation = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnHandleDestroyed(e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue