Hi , I have a question that I wasn’t able to solve I even asked in unreal source discord and I’m at my wits end here
Context: I made 2 widget classes inheriting from editor utility widgets and I use one of them(Child widget) as child widgets to fill a grid panel in the other main widget(main widget) and have a TArray<Childwidget*> ChildWidgets
in main widget, now the problem is whenever I access this Array and modify something in it whether Add or swap it freezes the main widget/editor for ~40 seconds while the BP counterpart of same code takes ~2s and I can’t figure out why but here are my test results with an array of 30 childwidgets:
1- ~40 second when I use a Array Swap a single time
2- This is array size dependent as I tested array size of 2 and was ~2sec
3- I debugged in VS with breakpoints and it was < 1ms while the editor was frozen for 40 seconds
4- I tried insights and the swap function was 6.3 microsecond while slate_DrawWindows & Slate_PaintSlowPath was around 40- 1min duration inclusive time.
5- When I add extra GridPanel->AddChildToGrid function it takes around 18 seconds.
Things I’ve tried:
1- Disable autosave
2- I can’t remember but I tried many things
“Why don’t you stick with BP version if it works?” you may ask well it’s because I plan to release it as a plugin.
If you have any idea why this might be happening , have something in mind no matter how minor or need insight pics please let me know.
Solved: Made Child widget array into TWeakObjectPtr instead of raw pointers and problem is gone