diff --git a/src/batmon/batmon.c b/src/batmon/batmon.c index 018ddbaa7e..4ebc110d21 100644 --- a/src/batmon/batmon.c +++ b/src/batmon/batmon.c @@ -243,6 +243,7 @@ void log_new_percentage(int new_bat_value, int is_charging) const char *delete_sql = "DELETE FROM bat_activity WHERE id = (SELECT MIN(id) FROM bat_activity);"; sqlite3_prepare_v2(bat_log_db, delete_sql, -1, &stmt, 0); sqlite3_step(stmt); + sqlite3_finalize(stmt); } } close_battery_log_db(); diff --git a/src/common/system/lang.h b/src/common/system/lang.h index f4f9e73e32..6062989673 100644 --- a/src/common/system/lang.h +++ b/src/common/system/lang.h @@ -92,7 +92,7 @@ void lang_removeIconLabels(bool remove_icon_labels, bool remove_hints) } json_save(root, file_path); - cJSON_free(root); + cJSON_Delete(root); } closedir(dp); } @@ -157,7 +157,7 @@ bool lang_load(void) } } - cJSON_free(lang_file); + cJSON_Delete(lang_file); return true; } diff --git a/src/common/system/settings.h b/src/common/system/settings.h index da7395d477..6d6d8f49ec 100644 --- a/src/common/system/settings.h +++ b/src/common/system/settings.h @@ -155,7 +155,7 @@ void _settings_load_keymap(void) json_getInt(keymap, "ingame_double_press", &settings.ingame_double_press); json_getString(keymap, "mainui_button_x", settings.mainui_button_x); json_getString(keymap, "mainui_button_y", settings.mainui_button_y); - cJSON_free(keymap); + cJSON_Delete(keymap); } void _settings_load_mainui(void) @@ -188,7 +188,7 @@ void _settings_load_mainui(void) strcpy(settings.theme, DEFAULT_THEME_PATH); } - cJSON_free(json_root); + cJSON_Delete(json_root); } void settings_load(void) @@ -384,7 +384,7 @@ bool settings_saveSystemProperty(const char *prop_name, int value) cJSON_SetNumberValue(prop, value); json_save(json_root, MAIN_UI_SETTINGS); - cJSON_free(json_root); + cJSON_Delete(json_root); temp_flag_set("settings_changed", true); return true; diff --git a/src/common/theme/config.h b/src/common/theme/config.h index 423063fff1..e9e20812e7 100644 --- a/src/common/theme/config.h +++ b/src/common/theme/config.h @@ -176,7 +176,7 @@ bool theme_applyConfig(Theme_s *config, const char *config_path, json_getInt(json_frame, "border-left", &config->frame.border_left); json_getInt(json_frame, "border-right", &config->frame.border_right); - cJSON_free(json_root); + cJSON_Delete(json_root); return true; } @@ -244,7 +244,7 @@ static bool _theme_overrides_changed = false; void theme_freeOverrides(void) { if (_theme_overrides != NULL) - cJSON_free(_theme_overrides); + cJSON_Delete(_theme_overrides); _theme_overrides = NULL; } diff --git a/src/common/utils/apply_icons.h b/src/common/utils/apply_icons.h index d8a5272148..3b74a38e32 100644 --- a/src/common/utils/apply_icons.h +++ b/src/common/utils/apply_icons.h @@ -82,7 +82,7 @@ bool apply_singleIconByFullPath(const char *config_path, const char *icon_path) json_forceSetString(config, "iconsel", sel_path); _saveConfigFile(config_path, cJSON_Print(config)); - cJSON_free(config); + cJSON_Delete(config); return true; } @@ -174,7 +174,7 @@ bool _apply_singleIconFromPack(const char *config_path, json_forceSetString(config, "icon", icon_path); _saveConfigFile(config_path, cJSON_Print(config)); - cJSON_free(config); + cJSON_Delete(config); printf_debug("Applied icon to %s\nicon: %s\niconsel: %s\n", config_path, icon_path, sel_path); diff --git a/src/common/utils/json.h b/src/common/utils/json.h index 7ddc82fa30..401749f4de 100644 --- a/src/common/utils/json.h +++ b/src/common/utils/json.h @@ -85,7 +85,7 @@ bool json_forceSetString(cJSON *object, const char *key, const char *value) * @brief Loads and parses a json file. * * @param file_path - * @return cJSON* Root json object. Remember to cJSON_free the result. + * @return cJSON* Root json object. Remember to cJSON_Delete the result. */ cJSON *json_load(const char *file_path) { diff --git a/src/gameSwitcher/gameSwitcher.c b/src/gameSwitcher/gameSwitcher.c index 6107e1a8c3..da9154a6df 100644 --- a/src/gameSwitcher/gameSwitcher.c +++ b/src/gameSwitcher/gameSwitcher.c @@ -897,7 +897,7 @@ int main(int argc, char *argv[]) #endif if (json_root != NULL) - cJSON_free(json_root); + cJSON_Delete(json_root); SDL_BlitSurface(screen, NULL, video, NULL); SDL_Flip(video); diff --git a/src/infoPanel/infoPanel.c b/src/infoPanel/infoPanel.c index 54f31b97bd..e6158a4b95 100644 --- a/src/infoPanel/infoPanel.c +++ b/src/infoPanel/infoPanel.c @@ -76,7 +76,7 @@ static bool loadImagesPathsFromJson(const char *config_path, strncpy((*images_titles)[i], image_title, g_title_max_length); } - cJSON_free(json_root); + cJSON_Delete(json_root); return true; } diff --git a/src/randomGamePicker/randomGamePicker.c b/src/randomGamePicker/randomGamePicker.c index 3a9f611bd3..1628cf87ba 100644 --- a/src/randomGamePicker/randomGamePicker.c +++ b/src/randomGamePicker/randomGamePicker.c @@ -60,13 +60,13 @@ bool loadEmuConfig(char *emupath, char *emuname_out, char *romsdir_out, if (romsdir_out != NULL) { char romsdir_rel[STR_MAX]; if (!json_getString(json_root, "rompath", romsdir_rel)) { - cJSON_free(json_root); + cJSON_Delete(json_root); return false; } // Ignore Search results if (strncmp(romsdir_rel, "../../App/", 10) == 0) { - cJSON_free(json_root); + cJSON_Delete(json_root); return false; } @@ -95,7 +95,7 @@ bool loadEmuConfig(char *emupath, char *emuname_out, char *romsdir_out, imgpath_rel); } - cJSON_free(json_root); + cJSON_Delete(json_root); return true; } @@ -287,7 +287,7 @@ bool addRandomFromJson(char *json_path) count++; } - cJSON_free(json_root); + cJSON_Delete(json_root); } total_games_count = system_count = count; diff --git a/src/tweaks/icons.h b/src/tweaks/icons.h index 794bc95ebb..ba0e23a2ba 100644 --- a/src/tweaks/icons.h +++ b/src/tweaks/icons.h @@ -248,14 +248,14 @@ bool _add_config_icon(const char *path, const char *name, cJSON *config = json_load(config_path); if (!json_getString(config, "icon", icon_path)) { - cJSON_free(config); + cJSON_Delete(config); return false; } if (!json_getString(config, "label", label)) strncpy(label, name, STR_MAX - 1); - cJSON_free(config); + cJSON_Delete(config); ListItem item = {.action = action}; diff --git a/static/build/.tmp_update/script/scraper/scrap_launchbox.sh b/static/build/.tmp_update/script/scraper/scrap_launchbox.sh index 5fcc64adb8..24a9122a9a 100644 --- a/static/build/.tmp_update/script/scraper/scrap_launchbox.sh +++ b/static/build/.tmp_update/script/scraper/scrap_launchbox.sh @@ -235,7 +235,7 @@ set -f # ================= if ! [ -z "$CurrentRom" ]; then - romfilter="-name \"*$CurrentRom*\"" + romfilter="-name \"*$(echo "$CurrentRom" | sed -e 's_\[_\\\[_g' -e 's_\]_\\\]_g')*\"" fi diff --git a/static/build/.tmp_update/script/scraper/scrap_retroarch.sh b/static/build/.tmp_update/script/scraper/scrap_retroarch.sh index 5bd6e1ff6e..82218e70ea 100644 --- a/static/build/.tmp_update/script/scraper/scrap_retroarch.sh +++ b/static/build/.tmp_update/script/scraper/scrap_retroarch.sh @@ -128,7 +128,7 @@ if ! [ -z "$CurrentRom" ]; then # CurrentRom_noapostrophe=${CurrentRom//\'/\\\'} # replacing ' by \' # romfilter="-name '*$CurrentRom_noapostrophe*'" # romfilter="-name '*$CurrentRom*'" - romfilter="-name \"*$CurrentRom*\"" + romfilter="-name \"*$(echo "$CurrentRom" | sed -e 's_\[_\\\[_g' -e 's_\]_\\\]_g')*\"" #romfilter="-name '*$CurrentRom*'" fi diff --git a/static/build/.tmp_update/script/scraper/scrap_screenscraper.sh b/static/build/.tmp_update/script/scraper/scrap_screenscraper.sh index ee7865c92b..22e0d848be 100644 --- a/static/build/.tmp_update/script/scraper/scrap_screenscraper.sh +++ b/static/build/.tmp_update/script/scraper/scrap_screenscraper.sh @@ -387,7 +387,7 @@ if ! [ -z "$CurrentRom" ]; then # romfilter="-name '*$CurrentRom_noapostrophe*'" # romfilter="-name '*$CurrentRom*'" #romfilter="-name '*$CurrentRom*'" - romfilter="-name \"*$CurrentRom*\"" + romfilter="-name \"*$(echo "$CurrentRom" | sed -e 's_\[_\\\[_g' -e 's_\]_\\\]_g')*\"" fi diff --git a/website/docs/07-apps/02-community-apps/index.mdx b/website/docs/07-apps/02-community-apps/index.mdx index 9d0e3c2283..9afb80495e 100644 --- a/website/docs/07-apps/02-community-apps/index.mdx +++ b/website/docs/07-apps/02-community-apps/index.mdx @@ -43,3 +43,6 @@ Here you will find a selection of third party applications and tools compatible 9. [**WiFi Password Saver**](https://github.com/funkykovalski/WIFI) by funkykovalski *Script to save WiFi password* + +10. [**Lynx web browser**](https://github.com/tailtwo/lynx-miyoo) by snowram + *The Lynx terminal based web browser*