mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
CppKore: fix potential font resource leak
As of commit 168ad9aabd624510045d56aabcbfeff6f4aaad6f, we can assign uniform fonts to all child controls, but only 1 control can own the font resource. This is by default false since we do not want to free the resource when destroying the child controls, but we do want to free it once the parent window gets destroyed.
This commit is contained in:
parent
d5db4674a4
commit
8e81d99585
4
r5dev/thirdparty/cppnet/cppkore/Font.cpp
vendored
4
r5dev/thirdparty/cppnet/cppkore/Font.cpp
vendored
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
namespace Drawing
|
namespace Drawing
|
||||||
{
|
{
|
||||||
Font::Font(HWND Handle, const HFONT hFont)
|
Font::Font(HWND Handle, const HFONT hFont, const bool OwnsFont)
|
||||||
: _Handle(Handle), _NativeFont(hFont), _OwnsFont(false)
|
: _Handle(Handle), _NativeFont(hFont), _OwnsFont(OwnsFont)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
r5dev/thirdparty/cppnet/cppkore/Font.h
vendored
2
r5dev/thirdparty/cppnet/cppkore/Font.h
vendored
@ -10,7 +10,7 @@ namespace Drawing
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Font() = default;
|
Font() = default;
|
||||||
Font(HWND Handle, const HFONT hFont);
|
Font(HWND Handle, const HFONT hFont, const bool OwnsFont = false);
|
||||||
Font(HWND Handle, const Gdiplus::Font& FontObject);
|
Font(HWND Handle, const Gdiplus::Font& FontObject);
|
||||||
|
|
||||||
virtual ~Font();
|
virtual ~Font();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user