mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix Resource Watcher crash
This commit is contained in:
parent
113078af90
commit
d4738934f8
2 changed files with 27 additions and 25 deletions
|
|
@ -95,35 +95,37 @@ internal unsafe struct Record
|
|||
var path = handle->FileName().Clone();
|
||||
return new Record
|
||||
{
|
||||
Time = DateTime.UtcNow,
|
||||
Path = path,
|
||||
OriginalPath = ByteString.Empty,
|
||||
Collection = null,
|
||||
Handle = handle,
|
||||
ResourceType = handle->FileType.ToFlag(),
|
||||
Category = handle->Category.ToFlag(),
|
||||
RefCount = handle->RefCount,
|
||||
RecordType = RecordType.Destruction,
|
||||
Synchronously = OptionalBool.Null,
|
||||
ReturnValue = OptionalBool.Null,
|
||||
CustomLoad = OptionalBool.Null,
|
||||
Time = DateTime.UtcNow,
|
||||
Path = path,
|
||||
OriginalPath = ByteString.Empty,
|
||||
Collection = null,
|
||||
Handle = handle,
|
||||
ResourceType = handle->FileType.ToFlag(),
|
||||
Category = handle->Category.ToFlag(),
|
||||
RefCount = handle->RefCount,
|
||||
RecordType = RecordType.Destruction,
|
||||
Synchronously = OptionalBool.Null,
|
||||
ReturnValue = OptionalBool.Null,
|
||||
CustomLoad = OptionalBool.Null,
|
||||
AssociatedGameObject = string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
public static Record CreateFileLoad(ByteString path, ResourceHandle* handle, bool ret, bool custom)
|
||||
=> new()
|
||||
{
|
||||
Time = DateTime.UtcNow,
|
||||
Path = path.IsOwned ? path : path.Clone(),
|
||||
OriginalPath = ByteString.Empty,
|
||||
Collection = null,
|
||||
Handle = handle,
|
||||
ResourceType = handle->FileType.ToFlag(),
|
||||
Category = handle->Category.ToFlag(),
|
||||
RefCount = handle->RefCount,
|
||||
RecordType = RecordType.FileLoad,
|
||||
Synchronously = OptionalBool.Null,
|
||||
ReturnValue = ret,
|
||||
CustomLoad = custom,
|
||||
Time = DateTime.UtcNow,
|
||||
Path = path.IsOwned ? path : path.Clone(),
|
||||
OriginalPath = ByteString.Empty,
|
||||
Collection = null,
|
||||
Handle = handle,
|
||||
ResourceType = handle->FileType.ToFlag(),
|
||||
Category = handle->Category.ToFlag(),
|
||||
RefCount = handle->RefCount,
|
||||
RecordType = RecordType.FileLoad,
|
||||
Synchronously = OptionalBool.Null,
|
||||
ReturnValue = ret,
|
||||
CustomLoad = custom,
|
||||
AssociatedGameObject = string.Empty,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public partial class ResourceWatcher : IDisposable, ITab
|
||||
public class ResourceWatcher : IDisposable, ITab
|
||||
{
|
||||
public const int DefaultMaxEntries = 1024;
|
||||
public const RecordType AllRecords = RecordType.Request | RecordType.ResourceLoad | RecordType.FileLoad | RecordType.Destruction;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue