Skip to content

Commit

Permalink
fix windows crash bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
oneSitDown committed Dec 15, 2022
1 parent dd3117d commit 46aab8c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ void UAgoraVideoWidget::onUserOffline(agora::rtc::uid_t uid, agora::rtc::USER_OF
void UAgoraVideoWidget::onLeaveChannel(const agora::rtc::RtcStats& stats) {
AsyncTask(ENamedThreads::GameThread, [=]()
{
if (bIsDestruct)
{
UE_LOG(LogTemp, Warning, TEXT("UVideoWidget::onLeaveChannel bIsDestruct"));
return;
}
UE_LOG(LogTemp, Warning, TEXT("UVideoWidget::onLeaveChannel"));
agora::rtc::VideoCanvas videoCanvas;
videoCanvas.view = nullptr;
Expand Down Expand Up @@ -318,6 +323,8 @@ void UAgoraVideoWidget::NativeDestruct() {
delete RtcEngineProxy;

RtcEngineProxy = nullptr;

bIsDestruct = true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class AGORAEXAMPLE_API UAgoraVideoWidget : public UBaseAgoraUserWidget, public a

FSlateBrush EmptyBrush;

bool bIsDestruct = false;

void InitAgoraEngine(FString APP_ID, FString TOKEN, FString CHANNEL_NAME);

void SetUpUIEvent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@


#include "ProcessAudioRawDataWidget.h"
#include <string>
#import <Foundation/Foundation.h>

void UProcessAudioRawDataWidget::InitAgoraWidget(FString APP_ID, FString TOKEN, FString CHANNEL_NAME)
{
InitConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#include "AndroidPermission/Classes/AndroidPermissionFunctionLibrary.h"
#endif
#include <string>
#if PLATFORM_IOS
#import <Foundation/Foundation.h>
#endif
#include "ProcessAudioRawDataWidget.generated.h"

using namespace agora::rtc;
Expand Down

0 comments on commit 46aab8c

Please sign in to comment.