Skip to content

Commit 8925935

Browse files
authored
Merge pull request #303 from ibotha/trunk
Fix undefined behavior causing crash on ubuntu 24 in glfw vulkan example.
2 parents 7278df4 + 99935f2 commit 8925935

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/example_glfw_vulkan/main.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ pub const c = @cImport({
99
@cInclude("backends/dcimgui_impl_vulkan.h");
1010
});
1111

12-
var g_Allocator: *c.VkAllocationCallbacks = undefined;
12+
var g_Allocator: ?*c.VkAllocationCallbacks = null;
1313
var g_Instance: c.VkInstance = undefined;
1414
var g_PhysicalDevice: c.VkPhysicalDevice = undefined;
1515
var g_Device: c.VkDevice = undefined;
1616
var g_QueueFamily: ?u32 = null;
1717
var g_Queue: c.VkQueue = undefined;
1818
var g_DebugReport: c.VkDebugReportCallbackEXT = undefined;
19-
var g_PipelineCache: c.VkPipelineCache = undefined;
19+
var g_PipelineCache: c.VkPipelineCache = null;
2020
var g_DescriptorPool: c.VkDescriptorPool = undefined;
2121

22-
var g_MainWindowData: c.ImGui_ImplVulkanH_Window = undefined;
22+
var g_MainWindowData: c.ImGui_ImplVulkanH_Window = .{};
2323
var g_MinImageCount: u32 = 2;
2424
var g_SwapChainRebuild: bool = false;
2525

0 commit comments

Comments
 (0)