SetObject generates Access violation

Hi! Really big thanks for asking for the Callstack… I was able to solve the problem while debugging, but only 'cause you asked for Callstack… :smiley: Marked answer as solution!(I never ever used(/had to use) it before).

Hi! I tried to use Details->SetObject(asdfff);
Details is a DetailView pointer, and asdfff is an UObject pointer. asdfff is not null, and I don’t know what can be the problem. The build succeeds. When the SetObject function runs, the editor crashes with access violation.

Details is a nullptr in that case :stuck_out_tongue_winking_eye: not asdfff

Of course the error can come from somewhere else to. Provide the Callstack in that case.

:smiley: Ok, tested, but Details is not null, and the objects are the following:
Details is a TSharedPtr Details;
asdfff in an UPropertyHandler * asdfff;
UpropertyHandler is an uclass:

class BUILDIT_API UPropertyHandler : public UObject
	UPROPERTY(Category = "qwert", EditAnywhere)
		int32 testvar;

And here’s all I do with these components:

	FPropertyEditorModule& PropertyEditorModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
	FDetailsViewArgs DetailsViewArgs(false, false, false, FDetailsViewArgs::HideNameArea);
	// Create a new detailspanel
	Details = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
	SAssignNew(ToolkitWidget, SBorder)
			+ SVerticalBox::Slot()
				.Text(LOCTEXT("HelperLabel", "look."))
			+ SVerticalBox::Slot()


The access violation crash disappears if I comment the SetObject line.

Thanks for the comment… :slight_smile:

Edit: asdfff is a pointer to 0xcdcdcdcdcd… And the UPROPERTY(s) are returning memory read error… Idk why the pointer is bad. Any idea?

Where does asdfff come from? How did you initialize it? And Callstack please :stuck_out_tongue_winking_eye: