Skip to content

Commit 5325a2b

Browse files
committed
disp/vulkan: Use unique_ptr for frame mappings
1 parent aa79670 commit 5325a2b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/video_display/vulkan/vulkan_sdl2.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct state_vulkan_sdl2 {
189189
// Use raw pointers because std::unique_ptr might not have standard layout
190190
vkd::VulkanDisplay* vulkan = nullptr;
191191
WindowCallback* window_callback = nullptr;
192-
FrameMappings* frame_mappings = new FrameMappings();
192+
std::unique_ptr<FrameMappings> frame_mappings = std::make_unique<FrameMappings>();
193193

194194
std::atomic<bool> should_exit = false;
195195
video_desc current_desc{};
@@ -211,7 +211,6 @@ struct state_vulkan_sdl2 {
211211
state_vulkan_sdl2& operator=(state_vulkan_sdl2&& other) = delete;
212212

213213
~state_vulkan_sdl2() {
214-
delete frame_mappings;
215214
module_done(&mod);
216215
}
217216
};

0 commit comments

Comments
 (0)