mirror of
				https://gitlab.com/klmp200/LO27.git
				synced 2025-10-31 01:43:04 +00:00 
			
		
		
		
	Fix some leaks for SDL
This commit is contained in:
		| @@ -2,7 +2,7 @@ | |||||||
| * @Author: klmp200 | * @Author: klmp200 | ||||||
| * @Date:   2016-12-27 19:59:21 | * @Date:   2016-12-27 19:59:21 | ||||||
| * @Last Modified by:   klmp200 | * @Last Modified by:   klmp200 | ||||||
| * @Last Modified time: 2016-12-28 23:57:29 | * @Last Modified time: 2016-12-29 00:03:19 | ||||||
| */ | */ | ||||||
|  |  | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| @@ -64,6 +64,7 @@ int NewWindowFromMatrix(Matrix m){ | |||||||
| 	screen.HEIGHT = m.rowCount; | 	screen.HEIGHT = m.rowCount; | ||||||
|  |  | ||||||
| 	if (SDL_Init(SDL_INIT_VIDEO) < 0){ | 	if (SDL_Init(SDL_INIT_VIDEO) < 0){ | ||||||
|  | 		SDL_Quit(); | ||||||
| 		return 1; | 		return 1; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -83,5 +84,7 @@ int NewWindowFromMatrix(Matrix m){ | |||||||
| 	SDL_DestroyRenderer(screen.renderer); | 	SDL_DestroyRenderer(screen.renderer); | ||||||
| 	SDL_DestroyWindow(screen.window); | 	SDL_DestroyWindow(screen.window); | ||||||
|  |  | ||||||
|  | 	SDL_Quit(); | ||||||
|  |  | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user