Hi, I’ve been getting an intermittent crash when using the engine. It only seems to happen when I exit out of a PIE session.
I get a pop-up like this one:
I have tried to narrow down the class which is causing this error and it seems to be my custom UGameViewportClient
class I’ve derived. When I don’t use this class, I no longer get the problem.
I’m have looked through the source code and noticed that the UGameViewportClient
class multi-inherits from an FExec
class with one PURE_VIRTUAL function inside as seen here;
#pragma once
#include "CoreTypes.h"
#include "Misc/AssertionMacros.h"
// Any object that is capable of taking commands.
class CORE_API FExec
{
public:
virtual ~FExec();
/**
* Exec handler
*
* @param InWorld World context
* @param Cmd Command to parse
* @param Ar Output device to log to
*
* @return true if command was handled, false otherwise
*/
virtual bool Exec( class UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) PURE_VIRTUAL(FExec::Exec,return false;)
};
I’m not sure what I’m supposed to do with that though, or if that’s even the problem.
Here’s a copy of my custom GameViewportClient
class too which I have made which seems to contain the problem.
#include "PROJECT_NEUTRON/Viewport/PN_GameViewportClient.h"
#include "UnrealClient.h"
#include "PROJECT_NEUTRON/Camera/PN_PrimaryViewTarget.h"
#include "PROJECT_NEUTRON/Subsystem/PN_TouchInputSubsystem.h"
void UPN_GameViewportClient::Init(struct FWorldContext& WorldContext, UGameInstance* OwningGameInstance, bool bCreateNewAudioDevice)
{
Super::Init(WorldContext, OwningGameInstance);
}
bool UPN_GameViewportClient::InputTouch(FViewport* InViewport, int32 ControllerId, uint32 Handle, ETouchType::Type Type, const FVector2D& TouchLocation, float Force, FDateTime DeviceTimestamp, uint32 TouchpadIndex)
{
Super::InputTouch(InViewport, ControllerId, Handle, Type, TouchLocation, Force, DeviceTimestamp, TouchpadIndex);
switch (Type)
{
case ETouchType::Began:
TouchInputLocationBegin = TouchLocation;
break;
case ETouchType::Ended:
TouchInputLocationEnd = TouchLocation;
break;
}
return 0;
}
Any help would be appreciated, thanks!