x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

New C++ class wizard creates classes that crash the editor by default

The New C++ Class... wizard in the editor produces initially incomplete classes that can crash the editor. My assumption is that such new class stubs are intended to work properly with the engine (at least not cause crashes) even with no single line of code added?

The problem is that the classes produced by the wizard do not have a root component, and the editor occasionally dereferences the AActor::RootComponent pointer without checking whether it is non-null. One such dereference happens at:

actoreditorutils.cpp:77: for (auto* ChildComponent : InActor->GetRootComponent()->AttachChildren),

which is triggered at least when moving an actor between folders in the World Outliner.

Repro

  1. Create a blank C++ project

  2. Create a new C++ class with Actor as the base class

  3. Compile and relaunch the editor

  4. Drop an instance of the newly created class into the world

  5. Create a new folder in the World Outliner

  6. Try to move the newly created instance into that folder

The editor will crash (see stack trace at the end).

Suggestion

In addition to adding a null pointer check to actoreditorutils.cpp:77, it might be useful to have the new class wizard to add a dummy root component in the constructor to new classes, possibly together with a comment line encouraging the user to replace it with whatever is eventually needed. This way all new actors become also editor-movable already from the start, instead of being invisible and non-selectable (and crash-prone) in the editor viewport.

Stack trace

Access violation - code c0000005 (first/second chance not available)

""

UE4Editor_Engine!FActorEditorUtils::TraverseActorTree_ParentFirst() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\actoreditorutils.cpp:77] UE4Editor_SceneOutliner!SceneOutliner::FFolderDropTarget::OnDrop() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\sceneoutliner\private\foldertreeitem.cpp:141] UE4Editor_SceneOutliner!SceneOutliner::FFolderTreeItem::OnDrop() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\sceneoutliner\private\foldertreeitem.cpp:335] UE4Editor_SceneOutliner!SceneOutliner::HandleDrop() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\sceneoutliner\private\soutlinertreeview.cpp:101] UE4Editor_SceneOutliner!SceneOutliner::SSceneOutlinerTreeRow::OnDrop() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\sceneoutliner\private\soutlinertreeview.cpp:161] UE4Editor_Slate!::operator()() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4313] UE4Editor_Slate!FEventRouter::Route >() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:214] UE4Editor_Slate!FSlateApplication::RoutePointerUpEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4316] UE4Editor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4660] UE4Editor_Slate!FSlateApplication::OnMouseUp() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4638] UE4Editor_Core!FWindowsApplication::ProcessDeferredMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\windows\windowsapplication.cpp:1403] UE4Editor_Core!FWindowsApplication::DeferMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\windows\windowsapplication.cpp:1708] UE4Editor_Core!FWindowsApplication::ProcessMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\windows\windowsapplication.cpp:706] UE4Editor_Core!FWindowsApplication::AppWndProc() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\windows\windowsapplication.cpp:628] user32 user32 UE4Editor_Core!FWindowsPlatformMisc::PumpMessages() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\windows\windowsplatformmisc.cpp:884] UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launchengineloop.cpp:2392] UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launch.cpp:142] UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:126] UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]

Product Version: UE 4.9
Tags:
more ▼

asked Oct 21 '15 at 01:25 PM in Bug Reports

avatar image

hiili
205 15 25 37

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello hiili,

Thank you for your report. This is currently a known bug with version 4.9.2, and is entered in our database as UE-21194.

Have a great day,

Sean Flint

more ▼

answered Oct 21 '15 at 02:40 PM

avatar image

Sean L ♦♦ STAFF
43.5k 485 152 442

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question