From 9c87b3e7eab3b64c27661903e96156b00dcc5333 Mon Sep 17 00:00:00 2001 From: Tsanie Lily <tsorgy@gmail.com> Date: Tue, 26 May 2020 08:56:59 +0800 Subject: [PATCH] fix: endless loop issue --- Pixiview.Android/Properties/AndroidManifest.xml | 2 +- Pixiview.iOS.OpenExtension/Info.plist | 4 ++-- Pixiview.iOS/Info.plist | 4 ++-- Pixiview/Illust/IllustCollectionPage.cs | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Pixiview.Android/Properties/AndroidManifest.xml b/Pixiview.Android/Properties/AndroidManifest.xml index 3847804..8ecc7bc 100644 --- a/Pixiview.Android/Properties/AndroidManifest.xml +++ b/Pixiview.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0.525" package="org.tsanie.pixiview" android:versionCode="20"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0.526" package="org.tsanie.pixiview" android:versionCode="21"> <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="28" /> <application android:label="Pixiview" android:icon="@mipmap/icon" android:roundIcon="@mipmap/icon_round"></application> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> diff --git a/Pixiview.iOS.OpenExtension/Info.plist b/Pixiview.iOS.OpenExtension/Info.plist index 0b533f1..2543d17 100644 --- a/Pixiview.iOS.OpenExtension/Info.plist +++ b/Pixiview.iOS.OpenExtension/Info.plist @@ -29,8 +29,8 @@ <string>com.apple.share-services</string> </dict> <key>CFBundleShortVersionString</key> - <string>1.0.525</string> + <string>1.0.526</string> <key>CFBundleVersion</key> - <string>20</string> + <string>21</string> </dict> </plist> diff --git a/Pixiview.iOS/Info.plist b/Pixiview.iOS/Info.plist index f9f33df..2cb606b 100644 --- a/Pixiview.iOS/Info.plist +++ b/Pixiview.iOS/Info.plist @@ -79,9 +79,9 @@ </dict> </array> <key>CFBundleShortVersionString</key> - <string>1.0.525</string> + <string>1.0.526</string> <key>CFBundleVersion</key> - <string>20</string> + <string>21</string> <key>CFBundleDevelopmentRegion</key> <string>China</string> </dict> diff --git a/Pixiview/Illust/IllustCollectionPage.cs b/Pixiview/Illust/IllustCollectionPage.cs index 1b5b64f..dcafa5f 100644 --- a/Pixiview/Illust/IllustCollectionPage.cs +++ b/Pixiview/Illust/IllustCollectionPage.cs @@ -78,14 +78,14 @@ namespace Pixiview.Illust protected string lastError; private readonly object sync = new object(); - private readonly Queue<ParallelTask> tasks; + private readonly Stack<ParallelTask> tasks; private T illustData; public IllustCollectionPage() { commandIllustImageTapped = new Command<IllustItem>(OnIllustImageTapped); commandUserTapped = new Command<IIllustItem>(OnIllustUserItemTapped); - tasks = new Queue<ParallelTask>(); + tasks = new Stack<ParallelTask>(); BindingContext = this; } @@ -122,7 +122,7 @@ namespace Pixiview.Illust { lock (sync) { - while (tasks.TryDequeue(out var task)) + while (tasks.TryPop(out var task)) { if (task != null) { @@ -675,7 +675,7 @@ namespace Pixiview.Illust if (peek.TagIndex >= tag) { App.DebugPrint($"tasks expired ({tasks.Count}), peek: {peek.TagIndex}, now: {tag}, will be disposing."); - while (tasks.TryPeek(out var t)) + while (tasks.TryPop(out var t)) { if (t != null) { @@ -721,7 +721,7 @@ namespace Pixiview.Illust { lock (sync) { - tasks.Enqueue(task); + tasks.Push(task); } } }