From 745c9293868c547f37043295074d388fcd3fb4dc Mon Sep 17 00:00:00 2001 From: klmp200 Date: Thu, 29 Dec 2016 01:37:58 +0100 Subject: [PATCH] Fix some leaks for SDL --- LibGui/pixel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LibGui/pixel.c b/LibGui/pixel.c index f8cf988..b26926b 100644 --- a/LibGui/pixel.c +++ b/LibGui/pixel.c @@ -2,7 +2,7 @@ * @Author: klmp200 * @Date: 2016-12-27 19:59:21 * @Last Modified by: klmp200 -* @Last Modified time: 2016-12-28 23:57:29 +* @Last Modified time: 2016-12-29 00:03:19 */ #include @@ -64,6 +64,7 @@ int NewWindowFromMatrix(Matrix m){ screen.HEIGHT = m.rowCount; if (SDL_Init(SDL_INIT_VIDEO) < 0){ + SDL_Quit(); return 1; } @@ -83,5 +84,7 @@ int NewWindowFromMatrix(Matrix m){ SDL_DestroyRenderer(screen.renderer); SDL_DestroyWindow(screen.window); + SDL_Quit(); + return 0; }