зеркало из https://github.com/stride3d/opentk.git
Merge pull request #295 from BikingGlobetrotter/develop
[GLControl] Destroy context after OnHandleDestroyed to allow cleanup
This commit is contained in:
Коммит
92a45d5f90
|
@ -226,6 +226,10 @@ namespace OpenTK
|
|||
/// <param name="e">Not used.</param>
|
||||
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)
|
||||
{
|
||||
context.Dispose();
|
||||
|
@ -238,7 +242,6 @@ namespace OpenTK
|
|||
implementation = null;
|
||||
}
|
||||
|
||||
base.OnHandleDestroyed(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Загрузка…
Ссылка в новой задаче