Skip to content

Commit 955972c

Browse files
committed
Fixed search getting stuck in play mode if a pending Task is searched by reflection
1 parent ac55f29 commit 955972c

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

Plugins/AssetUsageDetector/Editor/Utilities.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Reflection;
44
using System.Text;
5+
using System.Threading.Tasks;
56
using Unity.Collections;
67
using UnityEditor;
78
using UnityEditor.SceneManagement;
@@ -359,6 +360,10 @@ public static bool IsIgnoredUnityType( this Type type )
359360
if( typeof( Type ).IsAssignableFrom( type ) || type.Namespace == reflectionNamespace )
360361
return true;
361362

363+
// Searching Tasks for reference may freeze Unity since Task.Result freezes the active thread if Task hasn't completed yet
364+
if (typeof(Task).IsAssignableFrom(type))
365+
return true;
366+
362367
// Searching pointers, ref variables or ref structs for reference throws ArgumentException
363368
if (type.IsPointer || type.IsByRef || type.IsByRefLike)
364369
return true;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Asset Usage Detector (v2.6.0) =
1+
= Asset Usage Detector (v2.6.1) =
22

33
Documentation: https://github.com/yasirkula/UnityAssetUsageDetector
44
E-mail: yasirkula@gmail.com

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.yasirkula.assetusagedetector",
33
"displayName": "Asset Usage Detector",
4-
"version": "2.6.0",
4+
"version": "2.6.1",
55
"documentationUrl": "https://github.com/yasirkula/UnityAssetUsageDetector",
66
"changelogUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/releases",
77
"licensesUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/blob/master/LICENSE.txt",

0 commit comments

Comments
 (0)