Merge remote-tracking branch 'upstream/master' into feature/inotificationmanager

This commit is contained in:
Soreepeong 2024-03-14 13:06:04 +09:00
commit 033a57d19d
51 changed files with 3594 additions and 1284 deletions

View file

@ -138,13 +138,18 @@ internal abstract class FontHandle : IFontHandle
/// An instance of <see cref="ILockedImFont"/> that <b>must</b> be disposed after use on success;
/// <c>null</c> with <paramref name="errorMessage"/> populated on failure.
/// </returns>
/// <exception cref="ObjectDisposedException">Still may be thrown.</exception>
public ILockedImFont? TryLock(out string? errorMessage)
{
IFontHandleSubstance? prevSubstance = default;
while (true)
{
var substance = this.Manager.Substance;
if (this.manager is not { } nonDisposedManager)
{
errorMessage = "The font handle has been disposed.";
return null;
}
var substance = nonDisposedManager.Substance;
// Does the associated IFontAtlas have a built substance?
if (substance is null)