Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a716d8

Browse files
committed
Fix missing glfwTerminate calls
1 parent 1398eaa commit 2a716d8

29 files changed

Lines changed: 60 additions & 1 deletion

03_Drawing_a_triangle/00_Setup/00_Base_code.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,16 @@ void mainLoop() {
307307
}
308308

309309
glfwDestroyWindow(window);
310+
311+
glfwTerminate();
310312
}
311313
```
312314

313315
This code should be fairly self-explanatory. It loops and checks for events like
314316
pressing the X button until the window has been closed by the user. This is also
315317
the loop where we'll later call a function to render a single frame. Once the
316-
window is closed, we need to clean up resources by destroying it.
318+
window is closed, we need to clean up resources by destroying it and GLFW]
319+
itself.
317320

318321
When you run the program now you should see a window titled `Vulkan` show up
319322
until the application is terminated by closing the window. Now that we have the

code/base_code.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class HelloTriangleApplication {
9696
}
9797

9898
glfwDestroyWindow(window);
99+
100+
glfwTerminate();
99101
}
100102
};
101103

code/command_buffers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ class HelloTriangleApplication {
181181
}
182182

183183
glfwDestroyWindow(window);
184+
185+
glfwTerminate();
184186
}
185187

186188
void createInstance() {

code/depth_buffering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ class HelloTriangleApplication {
295295
vkDeviceWaitIdle(device);
296296

297297
glfwDestroyWindow(window);
298+
299+
glfwTerminate();
298300
}
299301

300302
static void onWindowResized(GLFWwindow* window, int width, int height) {

code/descriptor_layout.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ class HelloTriangleApplication {
261261
vkDeviceWaitIdle(device);
262262

263263
glfwDestroyWindow(window);
264+
265+
glfwTerminate();
264266
}
265267

266268
static void onWindowResized(GLFWwindow* window, int width, int height) {

code/descriptor_set.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ class HelloTriangleApplication {
266266
vkDeviceWaitIdle(device);
267267

268268
glfwDestroyWindow(window);
269+
270+
glfwTerminate();
269271
}
270272

271273
static void onWindowResized(GLFWwindow* window, int width, int height) {

code/fixed_functions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ class HelloTriangleApplication {
173173
}
174174

175175
glfwDestroyWindow(window);
176+
177+
glfwTerminate();
176178
}
177179

178180
void createInstance() {

code/framebuffers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ class HelloTriangleApplication {
176176
}
177177

178178
glfwDestroyWindow(window);
179+
180+
glfwTerminate();
179181
}
180182

181183
void createInstance() {

code/graphics_pipeline.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ class HelloTriangleApplication {
169169
}
170170

171171
glfwDestroyWindow(window);
172+
173+
glfwTerminate();
172174
}
173175

174176
void createInstance() {

code/graphics_pipeline_complete.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ class HelloTriangleApplication {
175175
}
176176

177177
glfwDestroyWindow(window);
178+
179+
glfwTerminate();
178180
}
179181

180182
void createInstance() {

0 commit comments

Comments
 (0)