I’ll cut to the chase so I can get a bit of help on such a basic issue which is blocking my entire project.
Seems socket cannot be accessed for some reason, and it’s not nullptr.
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000028
UE4Editor_MyGame_4209!AMyGameMode::`scalar deleting destructor’()
class UTCPSocket : public FRunnable
… and overrides the necessary.
class AMyGameMode : public AGameModeBase
{
public:
virtual void BeginPlay() override;
~AMyGameMode();
private:
UTCPSocket* socket;
}
void AMyGameMode::BeginPlay()
{
socket = new UTCPSocket();
socket->Run(); // works fine
}
AMyGameMode::~AMyGameMode()
{
// socket is NOT nullptr at this point
socket->literally anything here; // this crashes the engine
}