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:
@ -87,6 +87,7 @@ namespace skyline::gpu {
|
||||
|
||||
// Create a texture as we cannot find one that matches
|
||||
auto texture{std::make_shared<Texture>(gpu, guestTexture)};
|
||||
texture->SetupGuestMappings();
|
||||
texture->TransitionLayout(vk::ImageLayout::eGeneral);
|
||||
auto it{texture->guest->mappings.begin()};
|
||||
textures.emplace(mappingEnd, TextureMapping{texture, it, guestMapping});
|
||||
|
Reference in New Issue
Block a user