t push origin master
All checks were successful
CI / Check spelling (push) Successful in 16s
CI / Check coding style (push) Successful in 30s
CI / Linux (ubuntu) (push) Successful in 9m56s
CI / Linux (fedora) (push) Successful in 10m29s
CI / Linux (arch) (push) Successful in 11m56s
CI / Linux (debian) (push) Successful in 12m11s
All checks were successful
CI / Check spelling (push) Successful in 16s
CI / Check coding style (push) Successful in 30s
CI / Linux (ubuntu) (push) Successful in 9m56s
CI / Linux (fedora) (push) Successful in 10m29s
CI / Linux (arch) (push) Successful in 11m56s
CI / Linux (debian) (push) Successful in 12m11s
Merge branch 'fix/theme-mem-leak'
This commit is contained in:
@@ -56,10 +56,9 @@
|
|||||||
#include "config/preferences.h"
|
#include "config/preferences.h"
|
||||||
#include "config/color.h"
|
#include "config/color.h"
|
||||||
|
|
||||||
static GString* theme_loc;
|
static GString* theme_loc = NULL;
|
||||||
static GKeyFile* theme;
|
static GKeyFile* theme = NULL;
|
||||||
static GHashTable* bold_items;
|
static GHashTable* defaults = NULL;
|
||||||
static GHashTable* defaults;
|
|
||||||
|
|
||||||
static void _load_preferences(void);
|
static void _load_preferences(void);
|
||||||
static void _theme_list_dir(const gchar* const dir, GSList** result);
|
static void _theme_list_dir(const gchar* const dir, GSList** result);
|
||||||
@@ -78,10 +77,6 @@ _theme_close(void)
|
|||||||
g_string_free(theme_loc, TRUE);
|
g_string_free(theme_loc, TRUE);
|
||||||
theme_loc = NULL;
|
theme_loc = NULL;
|
||||||
}
|
}
|
||||||
if (bold_items) {
|
|
||||||
g_hash_table_destroy(bold_items);
|
|
||||||
bold_items = NULL;
|
|
||||||
}
|
|
||||||
if (defaults) {
|
if (defaults) {
|
||||||
g_hash_table_destroy(defaults);
|
g_hash_table_destroy(defaults);
|
||||||
defaults = NULL;
|
defaults = NULL;
|
||||||
@@ -91,6 +86,12 @@ _theme_close(void)
|
|||||||
void
|
void
|
||||||
theme_init(const char* const theme_name)
|
theme_init(const char* const theme_name)
|
||||||
{
|
{
|
||||||
|
if (defaults || theme_loc || theme) {
|
||||||
|
log_warning("theme_init(): Detected non-NULL state (theme=%p, theme_loc=%p, defaults=%p). Cleaning up previous initialization.",
|
||||||
|
theme, theme_loc, defaults);
|
||||||
|
_theme_close();
|
||||||
|
}
|
||||||
|
|
||||||
if (!_theme_load_file(theme_name)) {
|
if (!_theme_load_file(theme_name)) {
|
||||||
log_error("Loading theme %s failed.", theme_name);
|
log_error("Loading theme %s failed.", theme_name);
|
||||||
|
|
||||||
|
|||||||
@@ -156,14 +156,7 @@ sv_ev_roster_received(void)
|
|||||||
if (!p_gpg_valid_key(account->pgp_keyid, &err_str)) {
|
if (!p_gpg_valid_key(account->pgp_keyid, &err_str)) {
|
||||||
cons_show_error("Invalid PGP key ID specified: %s, %s", account->pgp_keyid, err_str);
|
cons_show_error("Invalid PGP key ID specified: %s, %s", account->pgp_keyid, err_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redraw the screen after entry of the PGP secret key, but not init
|
|
||||||
ProfWin* win = wins_get_current();
|
|
||||||
auto_gchar gchar* theme = prefs_get_string(PREF_THEME);
|
|
||||||
win_redraw(win);
|
|
||||||
theme_init(theme);
|
|
||||||
ui_resize();
|
ui_resize();
|
||||||
ui_show_roster();
|
|
||||||
}
|
}
|
||||||
account_free(account);
|
account_free(account);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user