Skip to content
This repository has been archived by the owner on May 27, 2019. It is now read-only.

Commit

Permalink
App: Fix exception thrown when closing when yspath is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspiller committed Aug 26, 2009
1 parent 42a4b48 commit b82222c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Src/App/App.config
Expand Up @@ -2,6 +2,6 @@
<configuration>
<appSettings>
<clear />
<add key="YsPath" value="C:\dev\ysflight\20090502" />
<add key="YsPath" value="C:\dev\ysflight\20090611" />
</appSettings>
</configuration>
17 changes: 10 additions & 7 deletions Src/App/YsfoWrapper.cs
Expand Up @@ -69,13 +69,16 @@ public void Setup()

public void Dispose()
{
// save
LoadedAircraft.Save();
UnloadedAircraft.Save();
LoadedGround.Save();
UnloadedGround.Save();
LoadedScenery.Save();
UnloadedScenery.Save();
if (_ysfo.IsPathValid())
{
// save
if (LoadedAircraft != null) LoadedAircraft.Save();
if (UnloadedAircraft != null) UnloadedAircraft.Save();
if (LoadedGround != null) LoadedGround.Save();
if (UnloadedGround != null) UnloadedGround.Save();
if (LoadedScenery != null) LoadedScenery.Save();
if (UnloadedScenery != null) UnloadedScenery.Save();
}

// cleanup
_ysfo.Dispose();
Expand Down
3 changes: 0 additions & 3 deletions Src/Core/Core.csproj
Expand Up @@ -60,9 +60,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Ysfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion Ysfo.sln
Expand Up @@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other", "Other", "{23108114
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Installer", "Other\Installer\Installer.vdproj", "{7A5C9E9E-5643-4E92-9DA2-01526DFF9BBE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{A3CD0C8F-E42A-4C51-91A6-BFEEBABDCE36}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{A3CD0C8F-E42A-4C51-91A6-BFEEBABDCE36}"
ProjectSection(SolutionItems) = preProject
LICENSE.markdown = LICENSE.markdown
EndProjectSection
Expand Down

0 comments on commit b82222c

Please sign in to comment.