Skip to content

Commit 82e8ff2

Browse files
[Rendering] Fixes to Thumbnail Cache;
1 parent 3fafd6f commit 82e8ff2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Engine/Staple.Editor/ThumbnailCache.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,13 @@ void Cleanup()
248248
renderTarget.GetColorTexture(0).ReadPixels((texture, data) =>
249249
{
250250
tempEntity.Destroy();
251-
renderTarget.Destroy();
252251

253252
if (texture == null || data == null)
254253
{
255254
Cleanup();
256255

256+
renderTarget.Destroy();
257+
257258
return;
258259
}
259260

@@ -265,6 +266,8 @@ void Cleanup()
265266
data = data,
266267
};
267268

269+
renderTarget.Destroy();
270+
268271
try
269272
{
270273
var pngData = rawTextureData.EncodePNG();
@@ -443,6 +446,8 @@ void Cleanup()
443446
{
444447
Cleanup();
445448

449+
renderTarget.Destroy();
450+
446451
return;
447452
}
448453

@@ -503,10 +508,11 @@ void Cleanup()
503508
renderTarget.GetColorTexture(0).ReadPixels((texture, data) =>
504509
{
505510
tempEntity.Destroy();
506-
renderTarget.Destroy();
507511

508512
if (texture == null || data == null)
509513
{
514+
renderTarget.Destroy();
515+
510516
Cleanup();
511517

512518
return;
@@ -520,6 +526,8 @@ void Cleanup()
520526
data = data,
521527
};
522528

529+
renderTarget.Destroy();
530+
523531
try
524532
{
525533
var pngData = rawTextureData.EncodePNG();

0 commit comments

Comments
 (0)