Turn ImFontLocked into a class

As `ImFontLocked` utilizes a reference counter, changed it to a class so that at worst case we still got the destructor to decrease the reference count.
This commit is contained in:
Soreepeong 2024-01-23 23:39:25 +09:00
parent df89472d4c
commit 68dc16803c
5 changed files with 75 additions and 34 deletions

View file

@ -182,7 +182,7 @@ internal abstract class FontHandle : IFontHandle
// Transfer the ownership of reference.
errorMessage = null;
return new(fontPtr, substance.DataRoot);
return IFontHandle.ImFontLocked.Rent(fontPtr, substance.DataRoot);
}
}