Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor
Andrew Rodham 712719d060 Fixed crashes caused by shared pointer delegate bindings when reloading the level editor
Using AddSP to bind onto a multicast delegate that's removed in a class's destructor is dangerous because the weak pointer used to compare against the 'this' pointer passed to .RemoveAll() will be invalid by the time it is compared. This causes "HasSameObject" to fail as the object cannot be pinned. I've have changed these to be raw bindings so that the ownership is explicit and thus force the call to RemoveAll to succeed correctly without leaving behind a null delegate instance. Previously, with a null delegate instance still in the list when the module is reloaded, that memory becomes invalid causing a crash when the event attempts to purge invalid delegate instances from its invocation list.

Also fixed one place where OnTakeHighResScreenShots was being bound but never removed (this looked like a copy paste error)

This addresses TTP#337596 - CRASH: EDITOR: Reload after Recompile causes crash

#codereview Max.Preussner

[CL 2108007 by Andrew Rodham in Main branch]
2014-06-17 07:35:57 -04:00
..