mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-15 16:07:45 +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.IO;
|
||||
using Flowframes.Ui;
|
||||
using System;
|
||||
using System.IO;
|
||||
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}.");
|
||||
|
||||
string gpus = OsUtils.GetGpus();
|
||||
string windowTitle = "Flowframes";
|
||||
|
||||
if (installed.ToString() != "0.0.0")
|
||||
Program.mainForm.Text = $"Flowframes {installed}";
|
||||
windowTitle += $" {installed}";
|
||||
else
|
||||
Program.mainForm.Text = $"Flowframes [Unknown Version]";
|
||||
windowTitle += $" [Unknown Version]";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(gpus.Trim()))
|
||||
Program.mainForm.Text = $"{Program.mainForm.Text} [{gpus}]";
|
||||
if (gpus.Trim().IsEmpty())
|
||||
windowTitle += $"[{gpus}]";
|
||||
|
||||
Program.mainForm.Invoke(() => Program.mainForm.Text = windowTitle);
|
||||
}
|
||||
|
||||
public static async Task UpdateModelList()
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Flowframes.Ui
|
||||
{
|
||||
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();
|
||||
|
||||
if(num > 0)
|
||||
|
||||
Reference in New Issue
Block a user