mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Use weak_ptr
for TrapHandler
Callbacks
The lifetime of the `this` pointer in the trap callbacks could be invalid as the lifetime of the underlying `Buffer`/`Texture` object wasn't guaranteed, this commit fixes that by passing a `weak_ptr` of the objects into the callbacks which is locked during the callbacks and ensures that a destroyed object isn't accessed. Co-authored-by: Billy Laws <blaws05@gmail.com>
This commit is contained in:
@ -117,7 +117,7 @@ namespace skyline::gpu {
|
||||
friend BufferManager;
|
||||
|
||||
/**
|
||||
* @brief Sets up mirror mappings for the guest mappings
|
||||
* @brief Sets up mirror mappings for the guest mappings, this must be called after construction for the mirror to be valid
|
||||
*/
|
||||
void SetupGuestMappings();
|
||||
|
||||
@ -138,6 +138,10 @@ namespace skyline::gpu {
|
||||
return span<u8>(backing);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a buffer object wrapping the guest buffer with a backing that can represent the guest buffer data
|
||||
* @note The guest mappings will not be setup until SetupGuestMappings() is called
|
||||
*/
|
||||
Buffer(GPU &gpu, GuestBuffer guest);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user