Skip to content

Commit

Permalink
PAK: fix stream being closed after saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Weermann (TGE) committed Jul 9, 2020
1 parent a2bad7e commit c15b0c7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/Amicitia/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.9.3.0")]
[assembly: AssemblyFileVersion("1.9.3.0")]
[assembly: AssemblyVersion("1.9.4.0")]
[assembly: AssemblyFileVersion("1.9.4.0")]
2 changes: 1 addition & 1 deletion Source/Amicitia/ResourceWrappers/PAKFileSystemWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override void Initialize()

RegisterFileExportAction(SupportedFileType.PakArchiveFile, ( res, path ) =>
{
res.Save( path );
res.Save().SaveToFile( false, path );
} );
RegisterFileReplaceAction( SupportedFileType.PakArchiveFile, ( res, path ) =>
{
Expand Down
7 changes: 7 additions & 0 deletions Source/Amicitia/ResourceWrappers/ResourceWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -144,6 +145,7 @@ public bool NeedsRebuild
protected ResourceWrapper(string text, TResource resource)
: base(text)
{
Console.WriteLine( $"{this}: Creating wrapper for {resource}" );
Resource = resource;
FileType = SupportedFileManager.GetSupportedFileType(typeof(TResource));

Expand Down Expand Up @@ -564,6 +566,7 @@ private static SupportedFileType GetCorrectedSupportedFileType(int fileTypeIndex
/// </summary>
private void PopulateViewFully()
{
Console.WriteLine( $"{this}: Populating view" );
if (mInitialized)
Nodes.Clear();

Expand Down Expand Up @@ -654,6 +657,7 @@ private void RebuildResource()

if (mRebuildAction != null)
{
Console.WriteLine( $"{this}: Rebuilding" );
Resource = mRebuildAction.Invoke(this);
SetRebuildFlag(Parent);
}
Expand All @@ -662,7 +666,10 @@ private void RebuildResource()
public virtual void Dispose()
{
if ( Resource is IDisposable disposable )
{
Console.WriteLine( $"{this}: Disposing" );
disposable.Dispose();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/AmicitiaLibrary/AmicitiaLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Description>Library for parsing Atlus game formats.</Description>
<Copyright>Copyright © Atlus, TGE 2019</Copyright>
<Version>1.9.3.0</Version>
<Version>1.9.4.0</Version>
<RepositoryUrl>https://github.com/TGEnigma/Amicitia</RepositoryUrl>
</PropertyGroup>

Expand Down

0 comments on commit c15b0c7

Please sign in to comment.