Map not cleaned up by garbage collection!

I’m getting this error when RE-Starting the level on StandAlone Game.

Logs and Dumps are attached.

Note I’m aware of the BP compile error . Which an issue I’ll be posting in a separate Thread
link text

!Id:ea4253df2fefb57712c7100a0832c835

Unknown exception - code 00000001 (first/second  not available)

World //Game//Maps//AITestMap.AITestMap not cleaned up by garbage collection!
   (Object is not currently rooted)

KERNELBASE + 37901 bytes
UE4Editor_Core + 3095292 bytes
UE4Editor_Core + 1661738 bytes
UE4Editor_Engine + 9136154 bytes
UE4Editor_Engine + 9029087 bytes
UE4Editor_Engine + 8827382 bytes
UE4Editor_Engine + 9123021 bytes
UE4Editor_Engine + 3687371 bytes
UE4Editor!FEngineLoop::Tick() + 3294 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\launchengineloop.cpp:2098]
UE4Editor!GuardedMain() + 476 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\launch.cpp:133]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Hi ,

Could you provide a little more information about this issue?

  • How are you restarting the level (console command, code, etc.)?
  • Are you using UMG, by any ?

I restarted them via console command RestartLevel

yes I am using UMG. on version 4.4

Hi ,

We have an extremely similar crash related to loading a map via console command while UMG is being used that is already being investigated (UE-1226). I have added the information you provided to that report. Unfortunately I do not know when we might have this corrected.

2 Likes

I have similiar bug, crash when reloading level from umg but I’ve narrowed it down:
When player takes damage some blood splats are being spawned with small delay one after another and with lifespan set to about 2 seconds.
When he dies game is paused instantly and show ‘try again’ button, clicking it causes crash. Removing the part of bp that spawns those actors fixes it

not pausing also helps so I guess it’s something with that lifespan

Hi,

I’m a little late to the party, but I found that removing my widgets from the viewport when the HUD was destroyed fixed the issue for me.

1 Like

Are you still seeing this crash occur? We were no longer able to reproduce it internally after version 4.5.1.

Got this crash in 4.6.1. Removing the widget from viewport before opening a new level fixed it.

I’m still seeing this crash - recommended removal of widgets from viewport on EndPlay in the HUD works.

1 Like

Hi everyone,

Is this crash something that is happening only in your project, or can you reproduce it in a brand new project as well? Can you provide some idea of how you have your UMG widgets added to and removed from the viewport when the crash is happening?

Hey ,

I’m actually starting to encounter this as well in 4.6.1. I am not using UMG in this case but what I’ve added recently is the following…

I added a custom BP based off of an actor with a USceneComponent and an attached ParticleSystemComponent. In my custom GameInstance class, I hold a reference to this particular BP however if I try to call it at any point, I have made sure I am using an ‘IsValid’ node before calling the appropriate function on the BP in question.

I have two levels that have this BP within them and both load one after another. In the second level, it does get the current GameInstance and store the reference of it in there but the first level is simply just rendering the custom BP standalone.

At first I thought this is because it’s storing a reference and maybe is still holding on to it but that only happens in the level that follows and not the one that was showing right before it. The crash in my case is upon calling the ‘Open Level’ node to load the second level.

I’ll see if I can figure some stuff out but wanted to let you know just in case this info helps you dig deeper into the issue. Thanks.

BTW… as a heads up, this is not happening on restarting but starting the level for the first time.

Also , as a feature request, it would be great if the GameInstance class since it’s persistent across the entire game, could provide Events for Level Loaded and Level Destroyed and maybe have return values be the name of the persistent level that was just created or destroyed. Thanks again!

Hey ,

As a heads up, I fixed the issue by calling ‘Destroy Actor’ on both levels that use this BP. Not sure why the GC missed it but keep me posted if you need me to try a couple things out for you, thanks.

I had this problem on two separate occasions for 2 different reasons. The first time was because I wasn’t removing the HUD widgets when changing levels. The other was because I was using the GameInstance to store an array of object references to objects that were destroyed on the level change. When I added a clear command to the array on EndPlay it stopped crashing. I don’t know if this helps anyone else but it was a bit of a “Huzzah!” moment for me. :slight_smile:

It’s back in 4.9.1 ? … Everything crashes for me when reloading a map…

[2015.09.26-19.47.26:608][  4]LogReferenceChain:     (PendingKill) SupraballHUDBP_C /Game/Maps/Pitch.Pitch:PersistentLevel.SupraballHUDBP_C_0->Outer
[2015.09.26-19.47.26:608][  4]LogReferenceChain:       (PendingKill) Level /Game/Maps/Pitch.Pitch:PersistentLevel->OwningWorld
[2015.09.26-19.47.26:608][  4]LogReferenceChain:         (target) World /Game/Maps/Pitch.Pitch
[2015.09.26-19.47.26:919][  4]LogLoad:    (Object is not currently rooted)

[2015.09.26-19.47.26:919][  4]LogMac:Error: appError called: Assertion failed: Assertion failed:  [File:/Users/Shared/UnrealEngine/git-4.9.1/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp] [Line: 10258] 
World /Game/Maps/Pitch.Pitch not cleaned up by garbage collection!
   (Object is not currently rooted)

When I don’t use the UMG widgets it’s working. Will try removing on endplay.

Hey there. check if you’re using MID. It’s a recent bug that I reported . the error message looks quite similar ( object not rooter )

Unfortunately, removing the widget from viewport does not prevent the crash when put in:

  • EndPlay
  • ClearCrossLevelReferences (crash happens before its called)
  • BeginDestroy (crash happens before its called)

It does not crash when I add the widget and directly remove it again from the viewport.
Any ideas? : /

Yes it’s actually referencing a material instance dynamic… thanks for the hint .

Same problem here - 4.26.2

2 Likes