From 84e724f628f893475d083050eadebcdc350457f5 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Tue, 11 Nov 2025 21:35:27 +1100 Subject: [PATCH] Some memory fixes --- Dotnet/Program.cs | 15 +++++++++++++++ Dotnet/WebApi.cs | 12 +++++++++--- src/components/DataTable.vue | 1 - src/views/Charts/components/InstanceActivity.vue | 4 ++++ .../Charts/components/InstanceActivityDetail.vue | 4 ++++ 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Dotnet/Program.cs b/Dotnet/Program.cs index e7f75648..780fca2d 100644 --- a/Dotnet/Program.cs +++ b/Dotnet/Program.cs @@ -10,6 +10,7 @@ using System; using System.Data.SQLite; using System.Diagnostics.CodeAnalysis; using System.IO; +using System.Runtime.InteropServices; using System.Text.Json; using System.Threading; using System.Windows.Forms; @@ -189,6 +190,20 @@ namespace VRCX #endregion + #region Handle Out Of Memory + + catch (SEHException e) + { + logger.Fatal(e, "Unhandled SEH Exception, most likely out of memory, closing."); + var messageBoxResult = MessageBox.Show( + "VRCX has run out of memory and needs to close.\n" + + "We're actively working on fixing this issue. \n" + + e, "Out of Memory", MessageBoxButtons.OK, MessageBoxIcon.Error); + Environment.Exit(0); + } + + #endregion + catch (Exception e) { var cpuError = WinApi.GetCpuErrorMessage(); diff --git a/Dotnet/WebApi.cs b/Dotnet/WebApi.cs index c5ac2c52..c5624722 100644 --- a/Dotnet/WebApi.cs +++ b/Dotnet/WebApi.cs @@ -522,17 +522,23 @@ namespace VRCX await streamReader.ReadToEndAsync() ); } - + + var message = webException.Message; + if (webException.InnerException != null) + message += $" | Inner Exception: {webException.InnerException.Message}"; return new Tuple( -1, - webException.Message + message ); } catch (Exception e) { + var message = e.Message; + if (e.InnerException != null) + message += $" | Inner Exception: {e.InnerException.Message}"; return new Tuple( -1, - e.Message + message ); } } diff --git a/src/components/DataTable.vue b/src/components/DataTable.vue index 4c4ddeda..4c372289 100644 --- a/src/components/DataTable.vue +++ b/src/components/DataTable.vue @@ -1,7 +1,6 @@