Download

an exception occurred when using delegate

In MyActor.h file,I defined a delegate as following :

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FNewDataComes, FString, locationData);
UPROPERTY(BlueprintAssignable, Category = “NotifyData”)
FNewDataComes OnDataUpdated;

In MyActor.cpp file,i create a thread to receive data from another application.When new data comes,i use the delegate to notify the concerning blueprint.The thread i create is as following:

DWORD32 WINAPI MyStartReceiveData(LPVOID myparam)
{
//持续监听接收数据
char pszRecv[4096];
AMyActor* pDlg = (AMyActor*)myparam;
if (pDlg == NULL)
return 0;
while(true)
{
if (ConnectSocket!=NULL)
{
int nrev = recv(ConnectSocket, pszRecv, 4096, 0);
if (nrev>0)
{
pszRecv[nrev] = ‘\0’;
pDlg->OnDataUpdated.Broadcast(pszRecv);
}
}
}
return 0;
}

When i click the play button,the blueprint does receive the new data.However,when i end playing the game,an exception occurred as following:
SOutlinerTreeView.cpp(i never used it)530FQM}7I`W(6~13DT48C7G.png