[OpenTK] Removed the finalizer in OpenTK.Toolkit
This resolves crashes related to the platform factory being reset while resources are still live.
This commit is contained in:
parent
8b1be5c49a
commit
8f30f77b30
1 changed files with 5 additions and 8 deletions
|
@ -178,22 +178,19 @@ namespace OpenTK
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Print("OpenTK.Toolkit leaked, did you forget to call Dispose()?");
|
|
||||||
platform_factory = null;
|
|
||||||
toolkit = null;
|
|
||||||
initialized = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes this instance.
|
/// Finalizes this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~Toolkit()
|
~Toolkit()
|
||||||
{
|
{
|
||||||
Dispose(false);
|
Debug.Print("[Warning] {0} leaked, did you forget to call Dispose()?");
|
||||||
|
// We may not Dispose() the toolkit from the finalizer thread,
|
||||||
|
// as that will crash on many operating systems.
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue