SImage solid color only

I am making a menu in slate that has a menu bar and a bar that takes up the rest of the top of the screen. Right now I have what I’m showing below in the Construct method. However, this causes a crash, specifically a “Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff” crash after about 100 milliseconds. I am looking for how to fix this.

FSlateColorBrush FSB = FSlateColorBrush(FLinearColor::Gray);
	
	ChildSlot
		[
			SNew(SBorder)
		.HAlign(HAlign_Fill)
		.VAlign(VAlign_Fill)
		.OnMouseButtonDown(this, &SPRGDMenu::OnItemClicked)
		[
		SNew(SBox)
		.HeightOverride(1.0)
		.WidthOverride(100.0)
			[
			SNew(SHorizontalBox)
				+ SHorizontalBox::Slot()
				.HAlign(EHorizontalAlignment::HAlign_Left)
				.AutoWidth()
				.VAlign(EVerticalAlignment::VAlign_Top)
				[
					SPRGDMenu::MakeMenuBar()
				]
				+ SHorizontalBox::Slot()
				.VAlign(EVerticalAlignment::VAlign_Top)
				.FillWidth(1.0)
				[
					SNew(SImage)
                                         // code crashes here
					.Image(&FSB)
				]
			]
		]
	];

Alternatively, I am just looking for a way to make an SImage with a solid color in Slate.

You define a function local variable. It is destroyed as soon as the function Construct exits.
Define your brush as a class member.

I think what you said is the right answer but I don’t think I implemented it correctly.

I now have in the cpp file

+ SHorizontalBox::Slot()
		.VAlign(EVerticalAlignment::VAlign_Top)
		.FillWidth(1.0)
		[
			SNew(SImage)
			.Image(&FSB)
		]

and in the .h file I have

FSlateBrush FSB = FSlateColorBrush(FLinearColor::Black);

This has fixed the crash, since it no longer references an out of scope variable, but now the black SImage is not visible.