# Ui caching crash issue

**URL:** <https://forums.unrealengine.com/t/ui-caching-crash-issue/465559>\
**Category:** Platform & Builds\
**Tags:** crash-on-play, unreal-engine, question\
**Created:** [May 21, 2020, 9:06am UTC](https://forums.unrealengine.com/t/ui-caching-crash-issue/465559 "2020-05-21T09:06:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oilstar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oilstar](https://forums.unrealengine.com/u/oilstar)\
**Post date:** [May 21, 2020, 9:06am UTC](https://forums.unrealengine.com/t/ui-caching-crash-issue/465559/1 "2020-05-21T09:06:15Z")

</div>

ui caching 기능을 이용하는 경우에  
SlateInvalidationRoot 의 CachedElementData포인터 삭제처리로 인해 크래쉬가 발생합니다.  
UI OnPaint를 처리하면서 OutDrawElements에 CachedElementData를 저장하지만 문제는 FArrangedChildren 를 통한 정렬을 하고 나서 함수를 빠져 나올때 객체가 파괴되고 해당 객체는 원본과는 다르지만 FSlateInvalidationRoot 소멸자에서 포인트 변수를 delete처리하여 원본 객체의 포인터 변수의 포인터주소가 메모리 삭제되는 이슈가 발생합니다. 이후ESlateElementBatcher::AddCachedElements를 호출할때 해당 메모리가 삭제되어 CachedElementData주소를 접근할때 크래쉬가 발생합니다.
