sync with sylpheed 0.5.3cvs9
[claws.git] / src / main.c
index ae08074e2d5b215c81cf6f126cbd3957ef7ea869..04367abab4ce29e2b5fd3292536efc2cc21fd7ee 100644 (file)
 #  include <gpgme.h>
 #endif
 
-#if USE_SSL
-#  include "ssl.h"
-#endif
-
 #include "intl.h"
 #include "main.h"
 #include "mainwindow.h"
@@ -79,6 +75,9 @@
 #if USE_GPGME
 #  include "rfc2015.h"
 #endif
+#if USE_SSL
+#  include "ssl.h"
+#endif
 
 gchar *prog_version;
 gchar *startup_dir;
@@ -160,6 +159,10 @@ int main(int argc, char *argv[])
        gtk_widget_push_colormap(gdk_imlib_get_colormap());
 #endif
 
+#if USE_SSL
+       ssl_init();
+#endif
+
        srandom((gint)time(NULL));
 
        /* parse gtkrc files */
@@ -237,10 +240,6 @@ int main(int argc, char *argv[])
        gpgme_register_idle(idle_function_for_gpgme);
 #endif
 
-#if USE_SSL
-       ssl_init();
-#endif
-
        prefs_common_save_config();
        prefs_filter_read_config();
        prefs_filter_write_config();
@@ -294,10 +293,6 @@ int main(int argc, char *argv[])
 
        gtk_main();
 
-#if USE_SSL
-       ssl_done();
-#endif
-
        return 0;
 }
 
@@ -404,6 +399,10 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        filename = get_socket_name();
        unlink(filename);
 
+#if USE_SSL
+       ssl_done();
+#endif
+
        gtk_main_quit();
 }