# Stopping and Restarting Brain Component leaving a trail of "Garbage"?

**URL:** <https://forums.unrealengine.com/t/stopping-and-restarting-brain-component-leaving-a-trail-of-garbage/436101>\
**Category:** AI\
**Tags:** behavior-tree-task, unreal-engine, Blueprint, question\
**Created:** [October 22, 2018, 2:59am UTC](https://forums.unrealengine.com/t/stopping-and-restarting-brain-component-leaving-a-trail-of-garbage/436101 "2018-10-22T02:59:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Studiozone](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Studiozone](https://forums.unrealengine.com/u/Studiozone)\
**Post date:** [October 22, 2018, 2:59am UTC](https://forums.unrealengine.com/t/stopping-and-restarting-brain-component-leaving-a-trail-of-garbage/436101/1 "2018-10-22T02:59:27Z")

</div>

Hi everyone, maybe some of you can shed a light on this stuff.  
I notice when I for each time “Stopping” and “Restarting” the Brain Component that is connected to the AI Controller, it seams to leave a trail of “Garbage”.I saw this problem in “Behaviour Tree Blueprint Task”, in the list of “Debugging Filter”.

[For example (a blueprint task called TaskA)]  
**First time** when Game starts up:  
BTT\_TaskA\_C\_0  
BTT\_TaskA\_C\_0 in BC\_AIController

Then for each time I turn off and restarts Brain Component “Here its done **4 times** ”.  
BTT\_TaskA\_C\_1 in BC\_AIController  
BTT\_TaskA\_C\_2 in BC\_AIController  
BTT\_TaskA\_C\_3 in BC\_AIController  
BTT\_TaskA\_C\_4 in BC\_AIController  
etc…

So now in the Debug filter list I have totally **6 lines** but only Last one is Active:  
BTT\_TaskA\_C\_0  
BTT\_TaskA\_C\_0 in BC\_AIController  
BTT\_TaskA\_C\_1 in BC\_AIController  
BTT\_TaskA\_C\_2 in BC\_AIController  
BTT\_TaskA\_C\_3 in BC\_AIController  
**–\>BTT\_TaskA\_C\_4 in BC\_AIController**

I do understand this may not be a problem in certain cases, but when you have a village with a lots of NPC.  
And you want to turn off Animation and Behavior Tree when NPC is Inactive due performance sake.

So my question is:  
Is this “Garbage” still living in the memory or is it just Editor related thing I don’t need to be worried about?  
_If this is just an Editor related things, please make it possible to only show a “Fresh List”.  
It is very difficult to debugging AI when you turn off and on Brain Component._

(PS: **Unreal Engine 4.18.3** is in use)  
(Sorry for the red masking, Task had secret naming.)

Best Regards,  
Mattias Eriksson.

![257270-a-bug-maybe.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/6/3360797bc805e7341bc388f1d15e34785f9bd39c.png)
