x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 []
 LogOutputDevice: 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.

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?

Widget structure like this

alt text

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

My environment is Win10 enterprise, 4.20.1 source code.

Product Version: UE 4.20
Tags:
question.png (22.6 kB)
more ▼

asked Sep 22 '18 at 04:31 AM in Using UE4

avatar image

0xcdafd0f1
26 1 3

avatar image byg_ben Oct 01 '18 at 09:24 PM

I'm getting the same issue.

avatar image menjli Jan 12 '19 at 01:55 PM

I had the same error, in my case, it was a widget that did not get removed from the parent widget, so what I did is go to the child widget that is mentioned in the ensure error and attach remove from the parent when I close the parent widget, hope this helps you

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Reposting from UDN as we ran into it and one of the team found a fix


One of our team managed to track this down. Our project is based on an older version of ShooterGame - the newer versions of which have some updated code in ShooterGameViewportClient to Cleanup Slate Widgets when it the viewport client is destroyed.

He has updated ours to match, and the issue seems to have gone away. The ensure message was catching the issue, but the message was totally misleading.

 void UShooterGameViewportClient::BeginDestroy()
 {
     OldFocusWidget.Reset();
     LoadingScreenWidget.Reset();
     ViewportContentStack.Empty();
     HiddenViewportContentStack.Empty();
 
     Super::BeginDestroy();
 }

I imagine a lot of folks are basing their games on ShooterGame, so hopefully this will allow others to fix this if they run into it. Added his additional comments here:

 That also explains why I could fix that for BP widgets by passing the owner player in.
 
 That puts them on the AddWidgetForPlayer path which uses the layer manager. The latter just adds the content to a special per-player widget, bypassing the viewport client
 
 And that totally breaks the hidden widget stack in UShooterGameViewportClient

more ▼

answered Oct 30 '18 at 02:06 PM

avatar image

TheJamsh
775 53 81 131

avatar image Konflict Nov 14 '18 at 07:34 PM

Add to Player Screen blueprint node works, but the previously used Add to Viewport node is bugged. Will cause the ensure failed error showing up in 4.20.

(comments are locked)
10|2000 characters needed characters left

Make sure you pass the right value into the Owning Player input of the Create Widget node. It looks like the default got messed up in 4.20, and you have to set it explicitly now, unlike in previous engine versions.

more ▼

answered Oct 16 '18 at 01:47 PM

avatar image

bstone
114 2 13 12

avatar image byg_ben Oct 16 '18 at 03:13 PM

In my case it wasn't something that happened when running the game, but just when opening the widget in the editor.

avatar image bstone Oct 16 '18 at 03:15 PM

Oh, too bad then. I'm starting to think that's indeed a bug in 4.20. Today I've bumped into the same issue with UMG widgets that have the proper value for their Owning Player.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question