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

Skip to content

Commit 682658b

Browse files
committed
Add missing cleanup code for semaphores in tutorial content
1 parent e59ce23 commit 682658b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

03_Drawing_a_triangle/03_Drawing/02_Rendering_and_presentation.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ if (vkCreateSemaphore(device, &semaphoreInfo, nullptr, &imageAvailableSemaphore)
109109
}
110110
```
111111
112+
The semaphores should be cleaned up at the end of the program, when all commands
113+
have finished and no more synchronization is necessary:
114+
115+
```c++
116+
void cleanup() {
117+
vkDestroySemaphore(device, renderFinishedSemaphore, nullptr);
118+
vkDestroySemaphore(device, imageAvailableSemaphore, nullptr);
119+
```
120+
112121
## Acquiring an image from the swap chain
113122

114123
As mentioned before, the first thing we need to do in the `drawFrame` function

0 commit comments

Comments
 (0)