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();
|
var path = handle->FileName().Clone();
|
||||||
return new Record
|
return new Record
|
||||||
{
|
{
|
||||||
Time = DateTime.UtcNow,
|
Time = DateTime.UtcNow,
|
||||||
Path = path,
|
Path = path,
|
||||||
OriginalPath = ByteString.Empty,
|
OriginalPath = ByteString.Empty,
|
||||||
Collection = null,
|
Collection = null,
|
||||||
Handle = handle,
|
Handle = handle,
|
||||||
ResourceType = handle->FileType.ToFlag(),
|
ResourceType = handle->FileType.ToFlag(),
|
||||||
Category = handle->Category.ToFlag(),
|
Category = handle->Category.ToFlag(),
|
||||||
RefCount = handle->RefCount,
|
RefCount = handle->RefCount,
|
||||||
RecordType = RecordType.Destruction,
|
RecordType = RecordType.Destruction,
|
||||||
Synchronously = OptionalBool.Null,
|
Synchronously = OptionalBool.Null,
|
||||||
ReturnValue = OptionalBool.Null,
|
ReturnValue = OptionalBool.Null,
|
||||||
CustomLoad = OptionalBool.Null,
|
CustomLoad = OptionalBool.Null,
|
||||||
|
AssociatedGameObject = string.Empty,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Record CreateFileLoad(ByteString path, ResourceHandle* handle, bool ret, bool custom)
|
public static Record CreateFileLoad(ByteString path, ResourceHandle* handle, bool ret, bool custom)
|
||||||
=> new()
|
=> new()
|
||||||
{
|
{
|
||||||
Time = DateTime.UtcNow,
|
Time = DateTime.UtcNow,
|
||||||
Path = path.IsOwned ? path : path.Clone(),
|
Path = path.IsOwned ? path : path.Clone(),
|
||||||
OriginalPath = ByteString.Empty,
|
OriginalPath = ByteString.Empty,
|
||||||
Collection = null,
|
Collection = null,
|
||||||
Handle = handle,
|
Handle = handle,
|
||||||
ResourceType = handle->FileType.ToFlag(),
|
ResourceType = handle->FileType.ToFlag(),
|
||||||
Category = handle->Category.ToFlag(),
|
Category = handle->Category.ToFlag(),
|
||||||
RefCount = handle->RefCount,
|
RefCount = handle->RefCount,
|
||||||
RecordType = RecordType.FileLoad,
|
RecordType = RecordType.FileLoad,
|
||||||
Synchronously = OptionalBool.Null,
|
Synchronously = OptionalBool.Null,
|
||||||
ReturnValue = ret,
|
ReturnValue = ret,
|
||||||
CustomLoad = custom,
|
CustomLoad = custom,
|
||||||
|
AssociatedGameObject = string.Empty,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ using Penumbra.UI.Classes;
|
||||||
|
|
||||||
namespace Penumbra.UI;
|
namespace Penumbra.UI;
|
||||||
|
|
||||||
public partial class ResourceWatcher : IDisposable, ITab
|
public class ResourceWatcher : IDisposable, ITab
|
||||||
{
|
{
|
||||||
public const int DefaultMaxEntries = 1024;
|
public const int DefaultMaxEntries = 1024;
|
||||||
public const RecordType AllRecords = RecordType.Request | RecordType.ResourceLoad | RecordType.FileLoad | RecordType.Destruction;
|
public const RecordType AllRecords = RecordType.Request | RecordType.ResourceLoad | RecordType.FileLoad | RecordType.Destruction;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue