This is a very hard to reproduce bug, and the description that was given to us claimed: “had a blueprint stopped on a breakpoint. then pressed the stop button”. (We are on 4.6, with some changes ported over from 4.7 and 4.8)
Fatal error!
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000
UE4Editor-Engine.dll!FSceneViewport::OnMouseLeave()
UE4Editor-Slate.dll!SViewport::OnMouseLeave()
UE4Editor-Slate.dll!FSlateApplication::ProcessMouseMoveEvent()
UE4Editor-Slate.dll!FSlateApplication::OnMouseMove()
UE4Editor-Core.dll!FWindowsApplication::ProcessDeferredMessage()
UE4Editor-Core.dll!FWindowsApplication::DeferMessage()
UE4Editor-Core.dll!FWindowsApplication::ProcessMessage()
UE4Editor-Core.dll!FWindowsApplication::AppWndProc()
USER32.dll!UnknownFunction (0x00007ff96732250d)
USER32.dll!UnknownFunction (0x00007ff967322367)
UE4Editor-Core.dll!FWindowsPlatformMisc::PumpMessages()
UE4Editor-Core.dll!FGenericPlatformMisc::PeriodicallyPumpMessages()
UE4Editor-Engine.dll!UWPFAssetManager::GetData()
UE4Editor-Engine.dll!WPFAssetManagerInterface::GetData()
UE4Editor-WPFRenderer.dll!FileResourceLoader::Run()
UE4Editor-WPFRenderer.dll!LoadableObject::LoadData()
[...]
The code of the OnMouseLeave functions shows:
if (ViewportInterface.IsValid())
{
ViewportInterface.Pin()->OnMouseLeave(MouseEvent);
}
We believe that the ViewportInterface somehow got lost in between the IsValid and Pin call. This same structure happens through the whole file, except on one other location, where the Pin is called before doing the IsValid check (this occurs in the OnPaint function).
Are we correct to assume that all IsValid checks should only be called after the Pin function is called? In which case, the whole file could do with some rewriting…