free_ini
This commit is contained in:
		
							parent
							
								
									f68d99165b
								
							
						
					
					
						commit
						ab0cb7968e
					
				
							
								
								
									
										6
									
								
								dunst.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								dunst.c
									
									
									
									
									
								
							| @ -341,6 +341,9 @@ void update_lists() | |||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 to_move = most_important(notification_queue); |                 to_move = most_important(notification_queue); | ||||||
|  |                 if (!to_move) { | ||||||
|  |                         return; | ||||||
|  |                 } | ||||||
|                 n = (notification *) to_move->data; |                 n = (notification *) to_move->data; | ||||||
|                 n->start = now; |                 n->start = now; | ||||||
| 
 | 
 | ||||||
| @ -1641,10 +1644,10 @@ void parse_dunstrc(char *cmdline_config_path) | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fclose(config_file); |         fclose(config_file); | ||||||
|  |         free_ini(); | ||||||
|         xdgWipeHandle(&xdg); |         xdgWipeHandle(&xdg); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #endif                          /* STATIC_CONFIG */ |  | ||||||
| 
 | 
 | ||||||
| char *parse_cmdline_for_config_file(int argc, char *argv[]) | char *parse_cmdline_for_config_file(int argc, char *argv[]) | ||||||
| { | { | ||||||
| @ -1659,6 +1662,7 @@ char *parse_cmdline_for_config_file(int argc, char *argv[]) | |||||||
|         } |         } | ||||||
|         return NULL; |         return NULL; | ||||||
| } | } | ||||||
|  | #endif                          /* STATIC_CONFIG */ | ||||||
| 
 | 
 | ||||||
| int main(int argc, char *argv[]) | int main(int argc, char *argv[]) | ||||||
| { | { | ||||||
|  | |||||||
							
								
								
									
										12
									
								
								options.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								options.c
									
									
									
									
									
								
							| @ -42,6 +42,18 @@ section_t *new_section(char *name) | |||||||
|         return §ions[section_count -1]; |         return §ions[section_count -1]; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void free_ini(void) | ||||||
|  | { | ||||||
|  |         for(int i = 0; i < section_count; i++) { | ||||||
|  |                 for (int j = 0; j < sections[i].entry_count; j++) { | ||||||
|  |                         free(sections[i].entries[j].key); | ||||||
|  |                         free(sections[i].entries[j].value); | ||||||
|  |                 } | ||||||
|  |                 free(sections[i].entries); | ||||||
|  |         } | ||||||
|  |         free(sections); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| section_t *get_section(char *name) | section_t *get_section(char *name) | ||||||
| { | { | ||||||
|         for (int i = 0; i < section_count; i++) { |         for (int i = 0; i < section_count; i++) { | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ char *ini_get_string(char *section, char *key, const char *def); | |||||||
| int ini_get_int(char *section, char *key, int def); | int ini_get_int(char *section, char *key, int def); | ||||||
| double ini_get_double(char *section, char *key, int def); | double ini_get_double(char *section, char *key, int def); | ||||||
| int ini_get_bool(char *section, char *key, int def); | int ini_get_bool(char *section, char *key, int def); | ||||||
|  | void free_ini(void); | ||||||
| 
 | 
 | ||||||
| /* returns the next known section.
 | /* returns the next known section.
 | ||||||
|  * if section == NULL returns first section. |  * if section == NULL returns first section. | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Sascha Kruse
						Sascha Kruse