mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-17 21:37:43 +01:00
chore: don't report crashes when shutting down the game, if no devplugin is loaded
This commit is contained in:
parent
4f1257e79b
commit
ec0f52b7c3
4 changed files with 41 additions and 1 deletions
|
|
@ -244,6 +244,11 @@ internal sealed class DalamudConfiguration : IServiceType
|
|||
/// </summary>
|
||||
public int? PluginWaitBeforeFree { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not crashes during shutdown should be reported.
|
||||
/// </summary>
|
||||
public bool ReportShutdownCrashes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of saved styles.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ using Dalamud.Game.Gui.Internal;
|
|||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Plugin.Internal;
|
||||
using Dalamud.Utility;
|
||||
using PInvoke;
|
||||
using Serilog;
|
||||
|
||||
#if DEBUG
|
||||
|
|
@ -103,6 +104,16 @@ internal sealed class Dalamud : IServiceType
|
|||
public void Unload()
|
||||
{
|
||||
Log.Information("Trigger unload");
|
||||
|
||||
var reportCrashesSetting = Service<DalamudConfiguration>.GetNullable()?.ReportShutdownCrashes ?? true;
|
||||
var pmHasDevPlugins = Service<PluginManager>.GetNullable()?.InstalledPlugins.Any(x => x.IsDev) ?? false;
|
||||
if (!reportCrashesSetting && !pmHasDevPlugins)
|
||||
{
|
||||
// Leaking on purpose for now
|
||||
var attribs = Kernel32.SECURITY_ATTRIBUTES.Create();
|
||||
Kernel32.CreateMutex(attribs, false, "DALAMUD_CRASHES_NO_MORE");
|
||||
}
|
||||
|
||||
this.unloadSignal.Set();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -759,6 +759,12 @@ internal class DalamudInterface : IDisposable, IServiceType
|
|||
}
|
||||
}
|
||||
|
||||
if (ImGui.MenuItem("Report crashes at shutdown", null, configuration.ReportShutdownCrashes))
|
||||
{
|
||||
configuration.ReportShutdownCrashes = !configuration.ReportShutdownCrashes;
|
||||
configuration.QueueSave();
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
|
||||
if (ImGui.MenuItem("Open Dalamud branch switcher"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue