i am working on a procedural generation plugin and i need some free floating editor window to control the generation so i have made a child class of docktab i have function to toggle spawning the tab and the function is bound to a specific key .
the ui class link : SGenerationControllerTab
the function code
void ABaseProceduralActor::ToggleTab()
{
TabID=SGenerationControllerTab::TabName;
TSharedPtr<SDockTab> Tab = FGlobalTabmanager::Get()->FindExistingLiveTab(TabID);
if (Tab.IsValid())
{
FGlobalTabmanager::Get()->UnregisterTabSpawner(TabID);
return;
}
else
{
// Open the UI if it's not already open
TSharedRef<SGenerationControllerTab> Tabb = SNew(SGenerationControllerTab);
Tabb->RegisterTabSpawner();
FGlobalTabmanager::Get()->TryInvokeTab(Tabb->GetTabIdentifier());
}
}
so when pressing the key while running the game in the editor
its crashing the editor
can anyone help me why this is happening