mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 08:27:44 +01:00
Fixed a cross-thread UI call & possible null ref
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Flowframes.Data;
|
using Flowframes.Data;
|
||||||
using Flowframes.IO;
|
using Flowframes.IO;
|
||||||
|
using Flowframes.Ui;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -91,14 +92,17 @@ namespace Flowframes.Os
|
|||||||
Logger.Log($"You are running Flowframes {installed}. The latest Patreon version is {latestPat}, the latest free version is {latestFree}.");
|
Logger.Log($"You are running Flowframes {installed}. The latest Patreon version is {latestPat}, the latest free version is {latestFree}.");
|
||||||
|
|
||||||
string gpus = OsUtils.GetGpus();
|
string gpus = OsUtils.GetGpus();
|
||||||
|
string windowTitle = "Flowframes";
|
||||||
|
|
||||||
if (installed.ToString() != "0.0.0")
|
if (installed.ToString() != "0.0.0")
|
||||||
Program.mainForm.Text = $"Flowframes {installed}";
|
windowTitle += $" {installed}";
|
||||||
else
|
else
|
||||||
Program.mainForm.Text = $"Flowframes [Unknown Version]";
|
windowTitle += $" [Unknown Version]";
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(gpus.Trim()))
|
if (gpus.Trim().IsEmpty())
|
||||||
Program.mainForm.Text = $"{Program.mainForm.Text} [{gpus}]";
|
windowTitle += $"[{gpus}]";
|
||||||
|
|
||||||
|
Program.mainForm.Invoke(() => Program.mainForm.Text = windowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task UpdateModelList()
|
public static async Task UpdateModelList()
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace Flowframes.Ui
|
|||||||
{
|
{
|
||||||
if (!progressPaused && AiProcess.processTime.IsRunning)
|
if (!progressPaused && AiProcess.processTime.IsRunning)
|
||||||
{
|
{
|
||||||
string lastLogLine = Logger.GetSessionLogLastLines(logFile, 1).Where(x => x.Contains("frame=")).LastOrDefault();
|
string lastLogLine = Logger.GetSessionLogLastLines(logFile, 1)?.Where(x => x.Contains("frame=")).LastOrDefault();
|
||||||
int num = lastLogLine == null ? 0 : lastLogLine.Split("frame=")[1].Split("fps=")[0].GetInt();
|
int num = lastLogLine == null ? 0 : lastLogLine.Split("frame=")[1].Split("fps=")[0].GetInt();
|
||||||
|
|
||||||
if(num > 0)
|
if(num > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user