mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Free resources on OTR shutdown
This commit is contained in:
parent
8cf7122e7a
commit
c98ce4299d
@ -2766,6 +2766,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
|||||||
if (strcmp(args[0], "gen") == 0) {
|
if (strcmp(args[0], "gen") == 0) {
|
||||||
ProfAccount *account = accounts_get_account(jabber_get_account_name());
|
ProfAccount *account = accounts_get_account(jabber_get_account_name());
|
||||||
otr_keygen(account);
|
otr_keygen(account);
|
||||||
|
account_free(account);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
} else if (strcmp(args[0], "myfp") == 0) {
|
} else if (strcmp(args[0], "myfp") == 0) {
|
||||||
|
@ -163,6 +163,14 @@ _otr_init(void)
|
|||||||
data_loaded = FALSE;
|
data_loaded = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_otr_shutdown(void)
|
||||||
|
{
|
||||||
|
if (jid != NULL) {
|
||||||
|
free(jid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_otr_poll(void)
|
_otr_poll(void)
|
||||||
{
|
{
|
||||||
@ -172,6 +180,9 @@ _otr_poll(void)
|
|||||||
static void
|
static void
|
||||||
_otr_on_connect(ProfAccount *account)
|
_otr_on_connect(ProfAccount *account)
|
||||||
{
|
{
|
||||||
|
if (jid != NULL) {
|
||||||
|
free(jid);
|
||||||
|
}
|
||||||
jid = strdup(account->jid);
|
jid = strdup(account->jid);
|
||||||
log_info("Loading OTR key for %s", jid);
|
log_info("Loading OTR key for %s", jid);
|
||||||
|
|
||||||
@ -253,11 +264,12 @@ _otr_keygen(ProfAccount *account)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jid != NULL) {
|
||||||
|
free(jid);
|
||||||
|
}
|
||||||
jid = strdup(account->jid);
|
jid = strdup(account->jid);
|
||||||
log_info("Generating OTR key for %s", jid);
|
log_info("Generating OTR key for %s", jid);
|
||||||
|
|
||||||
jid = strdup(account->jid);
|
|
||||||
|
|
||||||
gchar *data_home = xdg_get_data_home();
|
gchar *data_home = xdg_get_data_home();
|
||||||
GString *basedir = g_string_new(data_home);
|
GString *basedir = g_string_new(data_home);
|
||||||
free(data_home);
|
free(data_home);
|
||||||
@ -634,6 +646,7 @@ void
|
|||||||
otr_init_module(void)
|
otr_init_module(void)
|
||||||
{
|
{
|
||||||
otr_init = _otr_init;
|
otr_init = _otr_init;
|
||||||
|
otr_shutdown = _otr_shutdown;
|
||||||
otr_libotr_version = _otr_libotr_version;
|
otr_libotr_version = _otr_libotr_version;
|
||||||
otr_start_query = _otr_start_query;
|
otr_start_query = _otr_start_query;
|
||||||
otr_poll = _otr_poll;
|
otr_poll = _otr_poll;
|
||||||
|
@ -41,6 +41,7 @@ OtrlMessageAppOps* otr_messageops(void);
|
|||||||
GHashTable* otr_smpinitators(void);
|
GHashTable* otr_smpinitators(void);
|
||||||
|
|
||||||
void (*otr_init)(void);
|
void (*otr_init)(void);
|
||||||
|
void (*otr_shutdown)(void);
|
||||||
char* (*otr_libotr_version)(void);
|
char* (*otr_libotr_version)(void);
|
||||||
char* (*otr_start_query)(void);
|
char* (*otr_start_query)(void);
|
||||||
void (*otr_poll)(void);
|
void (*otr_poll)(void);
|
||||||
|
@ -305,6 +305,9 @@ _shutdown(void)
|
|||||||
muc_close();
|
muc_close();
|
||||||
caps_close();
|
caps_close();
|
||||||
ui_close();
|
ui_close();
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
otr_shutdown();
|
||||||
|
#endif
|
||||||
chat_log_close();
|
chat_log_close();
|
||||||
prefs_close();
|
prefs_close();
|
||||||
theme_close();
|
theme_close();
|
||||||
|
Loading…
Reference in New Issue
Block a user