Memory management with exchanged references in Blueprints

I’m making and UI and in order to facilitate communication between widgets, I’m passing references of the widgets to each other. For instance, I have widget blueprints of class A and B. I have their instances a and b contained inside a HUD blueprint. I set a B reference variable on a as b and an A reference variable on b as a.

I know that in C++, this could lead to some tricky memory management issues, so I’m wondering if I should avoid that in Blueprints. Is there a better pattern that I can use to achieve what I want?

Create getter methods in your HUD and have A and B grab the reference to the other through the HUD. Do not have A and B store references to each other.

You want to designate the HUD as the owner of these elements.