I am writing plugins for Unreal Engine 4 and I have noticed something strange about using widget Slots. for example when you write
this is being called
can you find where this pointer is deleted? I could find nothing. the `+` operator for adding slots is given to you by this macro
which becomes
and that's all there is.
Now I'm wondering when this slot object allocated on heap is destroyed? does TArray automatically delete pointers? how?
Code:
+ SHorizontalBox::Slot()
Code:
static FSlot& Slot() { return *(new FSlot()); }
can you find where this pointer is deleted? I could find nothing. the `+` operator for adding slots is given to you by this macro
Code:
SLATE_BEGIN_ARGS(SHorizontalBox) ... SLATE_SUPPORTS_SLOT(SHorizontalBox::FSlot) ... SLATE_END_ARGS(SHorizontalBox)
Code:
TArray< SHorizontalBox::FSlot* > Slots; WidgetArgsType& operator + (SHorizontalBox::FSlot& SlotToAdd) { Slots.Add( &SlotToAdd ); return *this; }
Now I'm wondering when this slot object allocated on heap is destroyed? does TArray automatically delete pointers? how?