Description

If a new editor plugin has a button added with OnClicked functionality, the editor will crash immediately when accessing the plugin. Removing the OnClicked portion of code allows the plugin to be accessed and the button to be pressed.

CrashReporter:
[Link Removed]

Steps to Reproduce
  1. Open UE4 Editor (code project)
  2. Add new plugin based on Editor Mode (EMPlugin)
  3. Make the following changes in EMPluginEdModeToolkit.cpp:
    • Change the following function to return true
      static bool IsWidgetEnabled()
      {
      	return GEditor->GetSelectedActors()->Num() != 0;
      }
      
    • Search for "DownButtonLabel" and add the following code below the close brace after it:
      + SVerticalBox::Slot()
      	.HAlign(HAlign_Center)
      	.AutoHeight()
      	[
      		SNew(SButton).Text(FText::FromString("Test Button")).OnClicked(this, &FCleanPluginEdModeToolkit::ReturnSimple)
      	]
      
    • Add the following function definition at the end of the file above the #undef:
      FReply FCleanPluginEdModeToolkit::ReturnSimple() const 
      { 
      	return FReply::Handled();
      }
      
  4. Add function deceleration for FReply ReturnSimple() const to EMPluginEdModeToolkit.h
  5. Compile with the editor closed
  6. Open the project and click the button for the plugin in the Modes tab of the main viewport

Result:
Editor crashes immediately upon trying to access the plugin.

Expected:
Modes tab switches to show the new plugin

Repro Rate:
3/3

Callstack

Assertion failed: SharedThis.Get() == this [Link Removed] [Line: 1093]

KERNELBASE
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_UnrealEd
UE4Editor_CleanPlugin_7065!TBaseDelegate<FReply>::CreateSP<FCleanPluginEdModeToolkit>() [c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:188]
UE4Editor_CleanPlugin_7065!SButton::FArguments::OnClicked<FCleanPluginEdModeToolkit>() [c:\program files (x86)\epic games\4.11\engine\source\runtime\slate\public\widgets\input\sbutton.h:54]
UE4Editor_CleanPlugin_7065!FCleanPluginEdModeToolkit::FCleanPluginEdModeToolkit() [f:\unreal projects\myproject5\plugins\cleanplugin\source\cleanplugin\private\cleanpluginedmodetoolkit.cpp:54]
UE4Editor_CleanPlugin_7065!FCleanPluginEdMode::Enter() [f:\unreal projects\myproject5\plugins\cleanplugin\source\cleanplugin\private\cleanpluginedmode.cpp:26]
UE4Editor_UnrealEd
UE4Editor_LevelEditor
UE4Editor_LevelEditor
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Slate
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
user32
user32
UE4Editor_Core
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Foundation - Cpp Tools - Plugin System
Affects Versions4.11
Target Fix4.13
Fix Commit2957165
Main Commit2973886
CreatedMar 16, 2016
ResolvedApr 27, 2016
UpdatedMay 2, 2018
View Jira Issue