@@ -502,6 +502,7 @@ static void init_menu_system_values(void)
502502 volume_percentage = 50 ; ///wrong value: setting default to 50
503503 }
504504 else {
505+ pclose (fp );
505506 fgets (res , sizeof (res )- 1 , fp );
506507
507508 /// Check if Volume is a number (at least the first char)
@@ -523,6 +524,7 @@ static void init_menu_system_values(void)
523524 brightness_percentage = 50 ; ///wrong value: setting default to 50
524525 }
525526 else {
527+ pclose (fp );
526528 fgets (res , sizeof (res )- 1 , fp );
527529
528530 /// Check if brightness is a number (at least the first char)
@@ -1011,6 +1013,7 @@ int FK_RunMenu(SDL_Surface *screen)
10111013 if (fp == NULL ) {
10121014 MENU_ERROR_PRINTF ("Failed to run command %s\n" , shell_cmd );
10131015 }
1016+ pclose (fp );
10141017
10151018 /// ------ Refresh screen ------
10161019 screen_refresh = 1 ;
@@ -1029,6 +1032,8 @@ int FK_RunMenu(SDL_Surface *screen)
10291032 if (fp == NULL ) {
10301033 MENU_ERROR_PRINTF ("Failed to run command %s\n" , shell_cmd );
10311034 }
1035+ pclose (fp );
1036+
10321037 /// ------ Refresh screen ------
10331038 screen_refresh = 1 ;
10341039 } else
@@ -1085,6 +1090,8 @@ int FK_RunMenu(SDL_Surface *screen)
10851090 if (fp == NULL ) {
10861091 MENU_ERROR_PRINTF ("Failed to run command %s\n" , shell_cmd );
10871092 }
1093+ pclose (fp );
1094+
10881095 /// ------ Refresh screen ------
10891096 screen_refresh = 1 ;
10901097 } else
@@ -1102,6 +1109,8 @@ int FK_RunMenu(SDL_Surface *screen)
11021109 if (fp == NULL ) {
11031110 MENU_ERROR_PRINTF ("Failed to run command %s\n" , shell_cmd );
11041111 }
1112+ pclose (fp );
1113+
11051114 /// ------ Refresh screen ------
11061115 screen_refresh = 1 ;
11071116 } else
@@ -1194,6 +1203,7 @@ int FK_RunMenu(SDL_Surface *screen)
11941203 MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
11951204 }
11961205 else{
1206+ pclose(fp);
11971207 usb_sharing = !usb_sharing;
11981208 }*/
11991209
@@ -1294,7 +1304,7 @@ int FK_RunMenu(SDL_Surface *screen)
12941304 if (fp == NULL ) {
12951305 MENU_ERROR_PRINTF ("Failed to run command %s\n" , shell_cmd );
12961306 }
1297-
1307+ pclose ( fp );
12981308 return MENU_RETURN_EXIT ;
12991309 }
13001310 else {
0 commit comments