"xxx Not cleaned up by garbage collection"

Hi,

I am new to game development and Unreal Engine 4. I am using version 4.6.1

I am trying to change the materials using UMG buttons in 3 levels (using UMG buttons) i.e Level1, Level2 and Level3. I need to change the materials for more than 5 objects. I created a Static Mesh Component and passed as a reference to UMG to get the widget. After changing the materials in one Level and when I tried to change the level, I am getting the following error and the editor closes.

It says there is an infinite loop in the Cone1 blueprint. Since I am trying to change the materials for all the cone object, I created a seperate class blueprint for the Cone.

I even tried to remove the viewport i.e. remove the parent (user widget) before opening the another level. I also tried with “Destroy Actor”. But still I couldnt fix this problem. I even attached my blueprint here.

Can somebody please help me to fix this issue?

Thanks in advance!

31433-error+message.png

[Log file][5]

Hello purmo037,

I was able to reproduce this issue on 4.6.1. However, I then tried it on 4.7 and it appears that this issue has been fixed in later versions of the engine. I was able to avoid the crash by using the following method. I hope that this helps.

My widget:

My player controller:

Make it a great day.

Thank you so much for your kind reply but the problem for me is that, I have 3 levels i.e Level1, Level2 and Level3. For eg: I have 3 cones in all the 3 levels. On event begin play, it should show the buttons Level1, Level2 and Level3, and the 3 cones. If I click the 1st cone, it should show the material Widget (Say M1, M2 buttons) and the M1 material should change for that 1st cone. If I click the 2nd cone, it should show the material Widget (Say M1, M2 buttons) and the M1 material should change for that 2nd cone, etc…

For each object, the material should change separately. After changing the material for each object, if I click Level2, it should go to the 2nd level.

The solution which you suggested is changing for all the 3 cones together.

I have attached an output window here:

Hello purmo037,

That was an example to point you in the right direction. I went ahead and took it a little further. I think this may be able to accomplish your goals. I hope this helps.

Make it a great day

I tried this example but still it didnt work in editor 4.6. It gets crashes. It works in 4.7.

But still the idea is different… Material M1 and M2 button should work for all the 3 cones… Here, M1 works for the 1st cone and not for the 2nd cone. Same for M2… M2 works for the 2nd cone and not for the 1st cone. Both M1 and M2 are not working for the 3rd cone.

It should not destroy the actor when I click on Material buttons… I think it should destroy when I click the level buttons (Level1, Level2 and Level3)

Hello purmo037,

I made this example in 4.6.1, would it be possible for you to provide your project so that I can take a closer look? After implementing the workaround (Destroying the actor) I no longer receive a crash when changing levels.

How should I send you the files? because I tried to put it in a zip folder but couldnt zip the project which I have, instead when I open a zip project, its opening a new project.

Hello purmo037,

You could zip it up and send it via Dropbox or google drive.

But the project file which is in zip folder is not working. May be I can try it on my home computer and send you by 9pm.

Your MailID?

Hello purmo037,

You can send me a private message on the forums and attach it there.

Hello purmo037,

I have a workaround for you. You will need to add the following to your Levels Widget. These nodes are set up to destroy all actors when the level is switched. NOTE: Make sure to use the generic “Actors” class. This will tell it to seek out anything that is derived from the actors class. I hope that this helps.

Workaround:

Make it a great day

Yes it solved the issue. Thank you so much.

I need one more help. Since you have my project now, I am asking this question.

Is it possible to write one blueprint class for all the objects.

For example: in Level1, I have 3 objects; Cone, Cube and Cylinder. For these 3 objects, I have created 3 blueprints which does the same process. Is it possible to keep one blueprint class for all those 3 objects?