X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Fsilc%2Fcore%2Fsilc-core.c;h=259d7a6f8698fd665e988d68b61c64a9d1a99cc8;hb=c1c904ec2af21f1c2b272d790b38d93824af5352;hp=8c38c5c7130c294b96197e8aee2671649ac52bd4;hpb=db5f308b9a3897c74514ad5b366fb43dfec52a7c;p=silc.git diff --git a/apps/irssi/src/silc/core/silc-core.c b/apps/irssi/src/silc/core/silc-core.c index 8c38c5c7..259d7a6f 100644 --- a/apps/irssi/src/silc/core/silc-core.c +++ b/apps/irssi/src/silc/core/silc-core.c @@ -292,8 +292,8 @@ void silc_opt_callback(poptContext con, } if (strcmp(opt->longName, "hostname") == 0) { - g_free(opt_hostname); - opt_hostname = g_strdup(arg); + silc_free(opt_hostname); + opt_hostname = strdup(arg); } if (strcmp(opt->longName, "list-ciphers") == 0) { @@ -372,6 +372,8 @@ silc_stopped(SilcClient client, void *context) SILC_LOG_DEBUG(("Client library has stopped")); if (idletag != -1) g_source_remove(idletag); + signal_emit("chat protocol deinit", 1, + chat_protocol_find("SILC")); } static void sig_gui_quit(SILC_SERVER_REC *server, const char *msg) @@ -404,9 +406,10 @@ static void sig_init_finished(void) } /* Initialize the SILC client */ + opt_hostname = (opt_hostname ? opt_hostname : silc_net_localhost()); if (!silc_client_init(silc_client, settings_get_str("user_name"), - opt_hostname ? opt_hostname : silc_net_localhost(), - settings_get_str("real_name"), silc_running, NULL)) { + opt_hostname, settings_get_str("real_name"), + silc_running, NULL)) { sleep(1); exit(1); return; @@ -564,12 +567,17 @@ void silc_core_deinit(void) if (idletag != -1) g_source_remove(idletag); - signal_emit("chat protocol deinit", 1, - chat_protocol_find("SILC")); + if (opt_hostname) + silc_free(opt_hostname); + if (opt_nickname) + g_free(opt_nickname); + signal_remove("setup changed", (SIGNAL_FUNC) sig_setup_changed); signal_remove("irssi init finished", (SIGNAL_FUNC) sig_init_finished); signal_remove("gui exit", (SIGNAL_FUNC) sig_gui_quit); + silc_hash_free(sha1hash); + silc_queue_deinit(); silc_server_deinit(); silc_channels_deinit(); @@ -580,7 +588,7 @@ void silc_core_deinit(void) chat_protocol_unregister("SILC"); - silc_pkcs_private_key_free(irssi_privkey); silc_pkcs_public_key_free(irssi_pubkey); + silc_pkcs_private_key_free(irssi_privkey); silc_client_free(silc_client); }