#endif
static int idletag = -1;
+static int running = 0;
/* SILC Client */
SilcClient silc_client = NULL;
static void
silc_running(SilcClient client, void *context)
{
+ running = 1;
SILC_LOG_DEBUG(("Client library is running"));
}
if (idletag != -1)
g_source_remove(idletag);
- int stopped = 0;
- silc_client_stop(silc_client, silc_stopped, &stopped);
-
- while (!stopped)
- silc_client_run_one(silc_client);
+ if (running) {
+ int stopped = 0;
+ silc_client_stop(silc_client, silc_stopped, &stopped);
+ while (!stopped)
+ silc_client_run_one(silc_client);
+ }
if (opt_hostname)
silc_free(opt_hostname);
chat_protocol_unregister("SILC");
- silc_pkcs_public_key_free(irssi_pubkey);
- silc_pkcs_private_key_free(irssi_privkey);
+ if (irssi_pubkey)
+ silc_pkcs_public_key_free(irssi_pubkey);
+ if (irssi_privkey)
+ silc_pkcs_private_key_free(irssi_privkey);
silc_client_free(silc_client);
}