# \[Repro\] Using UMG causes Garbage-Collection Crash on Client Connections

**URL:** <https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524>\
**Category:** UI\
**Tags:** garbage-collector, Map, unreal-engine, crash, Multiplayer, question, UMG\
**Created:** [January 30, 2015, 11:51pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524 "2015-01-30T23:51:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [January 30, 2015, 11:51pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/1 "2015-01-30T23:51:09Z")

</div>

I have a built & cooked version of my game, and am launching a Listen server and a Client from a command-line based Shortcut to the .exe. The shortcut loads me straight into a map, and the client is supposed to join it.

However, if my HUD class is hooked up to create and add my UMG widgets to the Viewport, the Client Crashes on load with a callstack that starts with: “Map not cleaned up by Garbage Collection”. Disconnecting the HUD functions to create the UMG widgets in the hud and re-cooking the content fixed the issue, but of course I have no HUD.

Will this be fixed for 4.7? It’s effectively not possible to test a packaged MP game if it uses UMG.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 2, 2015, 5:30pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/2 "2015-02-02T17:30:34Z")

</div>

Hello ,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

1. What version of the engine are you using for this project?
2. Can you reproduce this in a clean project?
3. If so, could you provide a detailed set of steps to reproduce this issue on our end?
4. When you say that you are adding your HUD class are you referring to a Widget blueprint or a HUD blueprint?

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [February 9, 2015, 12:47pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/3 "2015-02-09T12:47:53Z")

</div>

Hi Rudy,

- I’m using Version 4.6.1

- Yes, although you’ll have to create a custom HUD Class and UMG Widget. Simply make the HUD add the Widget to the Viewport on begin play. If you then export/package the game and try to join the server, you’ll instantly crash.

It’s also possible to test that in editor by un-checking ‘Use Single Process’ in the advanced play options. The Client window will crash.

- Widget class via the Hud. So ‘Create Widget From Class’ and ‘Add To Viewport’ in the HUD Blueprint.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 12, 2015, 8:26pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/4 "2015-02-12T20:26:36Z")

</div>

Hello ,

After following your instruction and running a few tests I was unable to reproduce this issue on our end. Is there any way you could send a simplified version of your project that has this issue occurring? Could you also send us your dxdiag?

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [February 13, 2015, 9:27am UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/5 "2015-02-13T09:27:58Z")

</div>

Shouldn’t be a problem Rudy, I’ve got to prep a project for Nick Darnell related to UMG as well, will try to do this today!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 20, 2015, 6:04pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/6 "2015-02-20T18:04:36Z")

</div>

Hello ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [May 30, 2015, 12:33pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/7 "2015-05-30T12:33:52Z")

</div>

Hi Rudy,

I have found a more reliable Reproducible case for this bug, which you can find here:

> **[\[Repro\] Adding UUserWidget To Viewport on BeginPlay Causes Crash On Clients](https://forums.unrealengine.com/questions/235519/repro-adding-uuserwidget-to-viewport-on-beginplay.html)**
>
> This occurs in Older builds of the engine as well, as far back as when UUserWidget was even a thing (4.5 I believe) On BeginPlay in my HUD, I'm creating some widgets and attempting to add them to the Viewport. If I do this, any client that I run in...

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [June 1, 2015, 2:55pm UTC](https://forums.unrealengine.com/t/repro-using-umg-causes-garbage-collection-crash-on-client-connections/305524/8 "2015-06-01T14:55:09Z")

</div>

Hello ,

I was reading back over the thread and I saw that you mentioned a custom class had to be used. The issue that you are seeing may be related to an issue that deals with widgets that are made in C++. Could you try and recreate this issue in blueprints only? This will help determine if the issue that you are experiencing is related to the known issue with C++ widgets being used in blueprints.
