Skip to content

Commit d4e3f68

Browse files
authored
Merge pull request #11 from g0415shenw/main
修复频繁打开导致渲染线程出现空指针崩溃的bug
2 parents 30dc169 + 9b50a97 commit d4e3f68

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Source/InVideo/Private/InVideoWidget.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void UInVideoWidget::UpdateTextureRegions(UTexture2D* Texture, int32 MipIndex, u
202202
RegionData->Texture2DResource = m_Texture2DResource;
203203
RegionData->MipIndex = MipIndex;
204204
RegionData->NumRegions = NumRegions;
205-
RegionData->Regions = Regions;
205+
RegionData->Regions = new FUpdateTextureRegion2D(*Regions);
206206
RegionData->SrcPitch = SrcPitch;
207207
RegionData->SrcBpp = SrcBpp;
208208
RegionData->SrcData = SrcData;
@@ -227,9 +227,11 @@ void UInVideoWidget::UpdateTextureRegions(UTexture2D* Texture, int32 MipIndex, u
227227
}
228228
if (bFreeData)
229229
{
230-
FMemory::Free(RegionData->Regions);
231-
FMemory::Free(RegionData->SrcData);
230+
//FMemory::Free(RegionData->Regions);
231+
//FMemory::Free(RegionData->SrcData);
232+
232233
}
234+
delete RegionData->Regions;
233235
delete RegionData;
234236
});
235237
}

0 commit comments

Comments
 (0)