fix: endless loop issue
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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" />
|
<uses-sdk android:minSdkVersion="25" android:targetSdkVersion="28" />
|
||||||
<application android:label="Pixiview" android:icon="@mipmap/icon" android:roundIcon="@mipmap/icon_round"></application>
|
<application android:label="Pixiview" android:icon="@mipmap/icon" android:roundIcon="@mipmap/icon_round"></application>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
<string>com.apple.share-services</string>
|
<string>com.apple.share-services</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.525</string>
|
<string>1.0.526</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>20</string>
|
<string>21</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -79,9 +79,9 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.525</string>
|
<string>1.0.526</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>20</string>
|
<string>21</string>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>China</string>
|
<string>China</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
@ -78,14 +78,14 @@ namespace Pixiview.Illust
|
|||||||
protected string lastError;
|
protected string lastError;
|
||||||
|
|
||||||
private readonly object sync = new object();
|
private readonly object sync = new object();
|
||||||
private readonly Queue<ParallelTask> tasks;
|
private readonly Stack<ParallelTask> tasks;
|
||||||
private T illustData;
|
private T illustData;
|
||||||
|
|
||||||
public IllustCollectionPage()
|
public IllustCollectionPage()
|
||||||
{
|
{
|
||||||
commandIllustImageTapped = new Command<IllustItem>(OnIllustImageTapped);
|
commandIllustImageTapped = new Command<IllustItem>(OnIllustImageTapped);
|
||||||
commandUserTapped = new Command<IIllustItem>(OnIllustUserItemTapped);
|
commandUserTapped = new Command<IIllustItem>(OnIllustUserItemTapped);
|
||||||
tasks = new Queue<ParallelTask>();
|
tasks = new Stack<ParallelTask>();
|
||||||
|
|
||||||
BindingContext = this;
|
BindingContext = this;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ namespace Pixiview.Illust
|
|||||||
{
|
{
|
||||||
lock (sync)
|
lock (sync)
|
||||||
{
|
{
|
||||||
while (tasks.TryDequeue(out var task))
|
while (tasks.TryPop(out var task))
|
||||||
{
|
{
|
||||||
if (task != null)
|
if (task != null)
|
||||||
{
|
{
|
||||||
@ -675,7 +675,7 @@ namespace Pixiview.Illust
|
|||||||
if (peek.TagIndex >= tag)
|
if (peek.TagIndex >= tag)
|
||||||
{
|
{
|
||||||
App.DebugPrint($"tasks expired ({tasks.Count}), peek: {peek.TagIndex}, now: {tag}, will be disposing.");
|
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)
|
if (t != null)
|
||||||
{
|
{
|
||||||
@ -721,7 +721,7 @@ namespace Pixiview.Illust
|
|||||||
{
|
{
|
||||||
lock (sync)
|
lock (sync)
|
||||||
{
|
{
|
||||||
tasks.Enqueue(task);
|
tasks.Push(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user