Skip to content

Commit 160f605

Browse files
committed
Added blank lines to end of files, destroyed renderer in close
1 parent 8c390a5 commit 160f605

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/.vscode
2-
/build
2+
/build

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ add_subdirectory(external)
1818

1919
target_link_libraries(crowdsim PUBLIC ${SDL2_LIBRARIES} external)
2020
target_include_directories(crowdsim PUBLIC "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/external")
21-
22-

src/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ void draw(SDL_Renderer* &render, std::vector<Actor> actors, Room room) {
115115
SDL_RenderPresent(render);
116116
}
117117

118-
void close(SDL_Window* win) {
118+
void close(SDL_Window* win, SDL_Renderer* render) {
119+
SDL_DestroyRenderer(render);
119120
SDL_DestroyWindow(win);
120121
SDL_Quit();
121122
}
122123

123124
int main() {
124125
SDL_Window* win = NULL;
125-
SDL_Surface* surface = NULL;
126126
SDL_Renderer* render = NULL;
127127

128128
std::vector<Actor> actors;
@@ -175,6 +175,6 @@ int main() {
175175
}
176176
}
177177

178-
close(win);
178+
close(win, render);
179179
return 0;
180180
}

0 commit comments

Comments
 (0)