Core/Utility: Fix font crash
Happened when the atlas was resizing while updating the text drawer, the old invalid pointer was kept (now a dangling pointer). Former-commit-id: d50153f81f1f2bdd80cfdac9dcee85eb7c28c35e
This commit is contained in:
@@ -113,7 +113,7 @@ class NAZARA_UTILITY_API NzFont : public NzRefCounted, public NzResource, NzNonC
|
||||
};
|
||||
|
||||
NazaraSignal(OnFontAtlasChanged, const NzFont*); //< Args: me
|
||||
NazaraSignal(OnFontAtlasLayerChanged, const NzFont*); //< Args: me
|
||||
NazaraSignal(OnFontAtlasLayerChanged, const NzFont*, NzAbstractImage*, NzAbstractImage*); //< Args: me, old layer, new layer
|
||||
NazaraSignal(OnFontDestroy, const NzFont*); //< Args: me
|
||||
NazaraSignal(OnFontGlyphCacheCleared, const NzFont*); //< Args: me
|
||||
NazaraSignal(OnFontKerningCacheCleared, const NzFont*); //< Args: me
|
||||
|
||||
@@ -43,6 +43,7 @@ class NAZARA_UTILITY_API NzSimpleTextDrawer : public NzAbstractTextDrawer
|
||||
static NzSimpleTextDrawer Draw(NzFont* font, const NzString& str, unsigned int characterSize, nzUInt32 style = nzTextStyle_Regular, const NzColor& color = NzColor::White);
|
||||
|
||||
private:
|
||||
void OnFontAtlasLayerChanged(const NzFont* font, NzAbstractImage* oldLayer, NzAbstractImage* newLayer);
|
||||
void OnFontInvalidated(const NzFont* font);
|
||||
void OnFontRelease(const NzFont* object);
|
||||
void UpdateGlyphs() const;
|
||||
|
||||
Reference in New Issue
Block a user