Skip to content

Commit

Permalink
Fix. Close active document or form close action with hi Cancel button…
Browse files Browse the repository at this point in the history
… leads to stop recording spectra.
  • Loading branch information
Am6er committed Mar 1, 2024
1 parent 6735436 commit 4091d11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions BecquerelMonitor/BecquerelMonitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<MinimumRequiredVersion>2022.07.08.7</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>index.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>2024.03.1.1</ApplicationVersion>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>2024.03.1.2</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
14 changes: 7 additions & 7 deletions BecquerelMonitor/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void InitializeToolViews()
// Token: 0x06000A4A RID: 2634 RVA: 0x0003CB48 File Offset: 0x0003AD48
void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (!this.initialized)
if (!this.initialized || e.Cancel)
{
return;
}
Expand Down Expand Up @@ -1279,14 +1279,14 @@ void CloseActiveDocument()
{
if (this.activeDocument != null)
{
this.StopRecordingOrTesting(this.activeDocument);
this.DestroyVCPThreads(this.activeDocument);
this.DestroyRCThreads(this.activeDocument);
if (this.ConfirmSaveDocument(this.activeDocument))
{
this.UnsubscribeDocumentEvent(this.activeDocument);
this.documentManager.CloseDocument(this.activeDocument);
}
this.StopRecordingOrTesting(this.activeDocument);
this.DestroyVCPThreads(this.activeDocument);
this.DestroyRCThreads(this.activeDocument);
}

GC.Collect();
Expand Down Expand Up @@ -1673,14 +1673,14 @@ void DocEnergySpectrum_FormClosing(object sender, FormClosingEventArgs e)
return;
}
DocEnergySpectrum docEnergySpectrum = (DocEnergySpectrum)sender;
this.StopRecordingOrTesting(docEnergySpectrum);
this.DestroyVCPThreads(docEnergySpectrum);
this.DestroyRCThreads(docEnergySpectrum);
if (!this.ConfirmSaveDocument(docEnergySpectrum))
{
e.Cancel = true;
return;
}
this.StopRecordingOrTesting(docEnergySpectrum);
this.DestroyVCPThreads(docEnergySpectrum);
this.DestroyRCThreads(docEnergySpectrum);
docEnergySpectrum.FormClosing -= this.DocEnergySpectrum_FormClosing;
}

Expand Down
4 changes: 2 additions & 2 deletions BecquerelMonitor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("2024.03.1.1")]
[assembly: AssemblyVersion("2024.03.1.2")]
[assembly: AssemblyProduct("BecquerelMonitor")]
[assembly: AssemblyCopyright("free")]
[assembly: AssemblyTrademark("none")]
[assembly: AssemblyConfiguration("")]
[assembly: Guid("40110b38-4882-47c1-ad94-a71e58dcb5f8")]
[assembly: AssemblyFileVersion("2024.03.1.1")]
[assembly: AssemblyFileVersion("2024.03.1.2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("free")]
[assembly: CompilationRelaxations(8)]
Expand Down

0 comments on commit 4091d11

Please sign in to comment.