Ensure condition failed: !IsGarbageCollecting()

This problem come from this:

There have two widget bp. A is main. B is a element in main. I drag some element from Palette to canvas to design a UI by UMG. The A was. when i’m working, maybe time’s up. Something happened. Maybe auto store or other i don’t known.

Them red error output into Output log window.

Here is stack.


Error: === Handled ensure: ===
Error: Ensure condition failed: !IsGarbageCollecting() [File:D:\UnrealEngine-4.20.1-release\Engine\Source\Runtime\UMG\Private\Slate\SObjectWidget.cpp] [Line: 41]
Error: SObjectWidget for 'ScrollBackgroundPanelWidget_C /Engine/Transient.World_1:MobileBag_C_2.WidgetTree_0.NealScrollBar' destroyed while collecting garbage. This can lead to multiple GCs being required to cleanup the object. Possible causes might be,
Error: 1) ReleaseSlateResources not being implemented for the owner of this pointer.
Error: 2) You may just be holding onto some slate pointers on an actor that don't get reset until the actor is Garbage Collected. You should avoid doing this, and instead reset those references when the actor is Destroyed.
Error: Stack:
Error: [Callstack] 0x00007ffecccf8e16 UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:235]
Error: [Callstack] 0x00007ffecca4f082 UE4Editor-Core.dll!FDebug::EnsureFailed() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\private\misc\assertionmacros.cpp:305]
Error: [Callstack] 0x00007ffecca67de6 UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalseImpl() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\private\misc\assertionmacros.cpp:436]
Error: [Callstack] 0x00007ffecb0980a3 UE4Editor-UMG.dll!SObjectWidget::~SObjectWidget() [d:\unrealengine-4.20.1-release\engine\source\runtime\umg\private\slate\sobjectwidget.cpp:41]
Error: [Callstack] 0x00007ffecbbb53b3 UE4Editor-SlateCore.dll!TIndirectArray<SBoxPanel::FSlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:434]
Error: [Callstack] 0x00007ffecbb5c1b3 UE4Editor-SlateCore.dll!SBoxPanel::~SBoxPanel() ]
Error: [Callstack] 0x00007ffecbbb52de UE4Editor-SlateCore.dll!TIndirectArray<SOverlay::FOverlaySlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:434]
Error: [Callstack] 0x00007ffecbb5c3a3 UE4Editor-SlateCore.dll!SOverlay::~SOverlay() ]
Error: [Callstack] 0x00007ffecbbb53b3 UE4Editor-SlateCore.dll!TIndirectArray<SBoxPanel::FSlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:434]
Error: [Callstack] 0x00007ffecbb5c1b3 UE4Editor-SlateCore.dll!SBoxPanel::~SBoxPanel() ]
Error: [Callstack] 0x00007ffecbbb52de UE4Editor-SlateCore.dll!TIndirectArray<SOverlay::FOverlaySlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:434]
Error: [Callstack] 0x00007ffecbb5c3a3 UE4Editor-SlateCore.dll!SOverlay::~SOverlay() ]
Error: [Callstack] 0x00007ffecbb5b4aa UE4Editor-SlateCore.dll!FSlotBase::~FSlotBase() [d:\unrealengine-4.20.1-release\engine\source\runtime\slatecore\private\slotbase.cpp:77]
Error: [Callstack] 0x00007ffecc0c24d2 UE4Editor-Slate.dll!TIndirectArray<SConstraintCanvas::FSlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:435]
Error: [Callstack] 0x00007ffecc099dac UE4Editor-Slate.dll!SConstraintCanvas::~SConstraintCanvas() ]
Error: [Callstack] 0x00007ffecbbb52de UE4Editor-SlateCore.dll!TIndirectArray<SOverlay::FOverlaySlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:434]
Error: [Callstack] 0x00007ffecbb5c3a3 UE4Editor-SlateCore.dll!SOverlay::~SOverlay() ]
Error: [Callstack] 0x00007ffecbb5b4aa UE4Editor-SlateCore.dll!FSlotBase::~FSlotBase() [d:\unrealengine-4.20.1-release\engine\source\runtime\slatecore\private\slotbase.cpp:77]
Error: [Callstack] 0x00007ffecc0c24d2 UE4Editor-Slate.dll!TIndirectArray<SConstraintCanvas::FSlot,FDefaultAllocator>::DestructAndFreeItems() [d:\unrealengine-4.20.1-release\engine\source\runtime\core\public\containers\indirectarray.h:435]
Error: [Callstack] 0x00007ffecc099dac UE4Editor-Slate.dll!SConstraintCanvas::~SConstraintCanvas() ]
Error: [Callstack] 0x00007ffecb152a7b UE4Editor-UMG.dll!UCanvasPanel::ReleaseSlateResources() [d:\unrealengine-4.20.1-release\engine\source\runtime\umg\private\components\canvaspanel.cpp:25]
Error: [Callstack] 0x00007ffecdce050f UE4Editor-CoreUObject.dll!UObject::ConditionalBeginDestroy() [d:\unrealengine-4.20.1-release\engine\source\runtime\coreuobject\private\uobject\obj.cpp:901]
Error: [Callstack] 0x00007ffecdcb4176 UE4Editor-CoreUObject.dll!UnhashUnreachableObjects() [d:\unrealengine-4.20.1-release\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1625]
Error: [Callstack] 0x00007ffecdc36afe UE4Editor-CoreUObject.dll!CollectGarbageInternal() [d:\unrealengine-4.20.1-release\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1576]
Error: [Callstack] 0x00007ffecdc35e7e UE4Editor-CoreUObject.dll!CollectGarbage() [d:\unrealengine-4.20.1-release\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1656]
Error: [Callstack] 0x00007ffec220f4b2 UE4Editor-UnrealEd.dll!FEditorFileUtils::AutosaveMapEx() [d:\unrealengine-4.20.1-release\engine\source\editor\unrealed\private\filehelpers.cpp:2507]
Error: [Callstack] 0x00007ffec24886bb UE4Editor-UnrealEd.dll!FPackageAutoSaver::AttemptAutoSave() [d:\unrealengine-4.20.1-release\engine\source\editor\unrealed\private\packageautosaver.cpp:195]
Error: [Callstack] 0x00007ffec27e2691 UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [d:\unrealengine-4.20.1-release\engine\source\editor\unrealed\private\unrealedengine.cpp:431]
Error: [Callstack] 0x00007ff7d93c5c0d UE4Editor.exe!FEngineLoop::Tick() [d:\unrealengine-4.20.1-release\engine\source\runtime\launch\private\launchengineloop.cpp:3495]
Error: [Callstack] 0x00007ff7d93d6aa0 UE4Editor.exe!GuardedMain() [d:\unrealengine-4.20.1-release\engine\source\runtime\launch\private\launch.cpp:166]
Error: [Callstack] 0x00007ff7d93d6b1a UE4Editor.exe!GuardedMainWrapper() [d:\unrealengine-4.20.1-release\engine\source\runtime\launch\private\windows\launchwindows.cpp:144]
Error: [Callstack] 0x00007ff7d93e3ef7 UE4Editor.exe!WinMain() [d:\unrealengine-4.20.1-release\engine\source\runtime\launch\private\windows\launchwindows.cpp:223]
Error: [Callstack] 0x00007ff7d93e5957 UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
Error: [Callstack] 0x00007ffef3d73034 KERNEL32.DLL!UnknownFunction ]
Error: [Callstack] 0x00007ffef6771461 ntdll.dll!UnknownFunction ]

The detail process is i’m making a UI by UMG. I create a new widget and drag some Common element into. Them i drag some “User Created” element into. All of them are old and has used in other widget and fine.

Now i have lots of element in my new widget and some of them are default from editor, others are old and in using.

The old not just one. But after shoot time. error come in.

I don’t known how it happen. Widget structure like this.

254388-question.png

It’s strange.

  1. All i used widget has used into other widget and fine.
  2. The error one create by right menu and inherit from User Widget. ReleaseSlateResource has implemented.
  3. The error one didn’t dynamically create. How to reset it when gc?

So, how to solve it. I had encounter it in two widget.

My environment is Win10 enterprise, 4.20.1 source code.

I’m getting this as well, and it’s infuriating. Apparently the issue is related to calling “Add To Player Screen”.

Was able to create minimal example to reproduce the issue and submitted a bug report.
Test project: WidgetEnsureTest.zip - Google Drive

Reproduction Steps:

  1. Hit Play
  2. Face the TESTTESTTEST actor. (Widgets need to tick)
  3. After 2…5 seconds stop play. Might need multiple tries.