File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void run()
3232
if( resultOperation.finished )
3333
{
3434
resultOperation.sendResultToUnity();
35-
dismiss();
35+
dismissAllowingStateLoss();
3636
}
3737
else
3838
{
@@ -132,7 +132,7 @@ public void onClick( DialogInterface dialog, int which )
132132
resultOperation.cancel();
133133
resultOperation.sendResultToUnity();
134134

135-
dismiss();
135+
dismissAllowingStateLoss();
136136
}
137137
} )
138138
.setCancelable( false )
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,11 @@ public static async Task<Texture2D> LoadImageAtPathAsync( string imagePath, int
806806
maxSize = SystemInfo.maxTextureSize;
807807

808808
#if !UNITY_EDITOR && UNITY_ANDROID
809-
string loadPath = await TryCallNativeAndroidFunctionOnSeparateThread( () => AJC.CallStatic<string>( "LoadImageAtPath", Context, imagePath, TemporaryImagePath, maxSize ) );
809+
string temporaryImagePath = TemporaryImagePath; // Must be accessed from main thread
810+
string loadPath = await TryCallNativeAndroidFunctionOnSeparateThread( () => AJC.CallStatic<string>( "LoadImageAtPath", Context, imagePath, temporaryImagePath, maxSize ) );
810811
#elif !UNITY_EDITOR && UNITY_IOS
811-
string loadPath = await Task.Run( () => _NativeGallery_LoadImageAtPath( imagePath, TemporaryImagePath, maxSize ) );
812+
string temporaryImagePath = TemporaryImagePath; // Must be accessed from main thread
813+
string loadPath = await Task.Run( () => _NativeGallery_LoadImageAtPath( imagePath, temporaryImagePath, maxSize ) );
812814
#else
813815
string loadPath = imagePath;
814816
#endif
@@ -941,9 +943,11 @@ public static async Task<Texture2D> GetVideoThumbnailAsync( string videoPath, in
941943
maxSize = SystemInfo.maxTextureSize;
942944

943945
#if !UNITY_EDITOR && UNITY_ANDROID
944-
string thumbnailPath = await TryCallNativeAndroidFunctionOnSeparateThread( () => AJC.CallStatic<string>( "GetVideoThumbnail", Context, videoPath, TemporaryImagePath + ".png", false, maxSize, captureTimeInSeconds ) );
946+
string temporaryImagePath = TemporaryImagePath; // Must be accessed from main thread
947+
string thumbnailPath = await TryCallNativeAndroidFunctionOnSeparateThread( () => AJC.CallStatic<string>( "GetVideoThumbnail", Context, videoPath, temporaryImagePath + ".png", false, maxSize, captureTimeInSeconds ) );
945948
#elif !UNITY_EDITOR && UNITY_IOS
946-
string thumbnailPath = await Task.Run( () => _NativeGallery_GetVideoThumbnail( videoPath, TemporaryImagePath + ".png", maxSize, captureTimeInSeconds ) );
949+
string temporaryImagePath = TemporaryImagePath; // Must be accessed from main thread
950+
string thumbnailPath = await Task.Run( () => _NativeGallery_GetVideoThumbnail( videoPath, temporaryImagePath + ".png", maxSize, captureTimeInSeconds ) );
947951
#else
948952
string thumbnailPath = null;
949953
#endif
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Native Gallery for Android & iOS (v1.7.1) =
1+
= Native Gallery for Android & iOS (v1.7.2) =
22

33
Online documentation & example code available at: https://.com/yasirkula/UnityNativeGallery
44
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.yasirkula.nativegallery",
33
"displayName": "Native Gallery",
4-
"version": "1.7.1",
4+
"version": "1.7.2",
55
"documentationUrl": "https://.com/yasirkula/UnityNativeGallery",
66
"changelogUrl": "https://.com/yasirkula/UnityNativeGallery/releases",
77
"licensesUrl": "https://.com/yasirkula/UnityNativeGallery/blob/master/LICENSE.txt",

0 commit comments

Comments
 (0)