diff --git a/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp b/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp index f247c34..ef1723a 100644 --- a/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp +++ b/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp @@ -7,6 +7,14 @@ //PRAGMA_DISABLE_OPTIMIZATION +void URichTextBlockForTypewriter::ReleaseSlateResources(bool bReleaseChildren) +{ + Super::ReleaseSlateResources(bReleaseChildren); + + TextLayout.Reset(); + TextMarshaller.Reset(); +} + TSharedRef URichTextBlockForTypewriter::RebuildWidget() { // Copied from URichTextBlock::RebuildWidget diff --git a/Source/StevesUEHelpers/Public/StevesUI/TypewriterTextWidget.h b/Source/StevesUEHelpers/Public/StevesUI/TypewriterTextWidget.h index 784d1b4..3baf640 100644 --- a/Source/StevesUEHelpers/Public/StevesUI/TypewriterTextWidget.h +++ b/Source/StevesUEHelpers/Public/StevesUI/TypewriterTextWidget.h @@ -36,6 +36,8 @@ public: return TextMarshaller; } + virtual void ReleaseSlateResources(bool bReleaseChildren) override; + protected: virtual TSharedRef RebuildWidget() override;