comparison libpurple/core.c @ 23404:3c1f1bed5be2

merge of '57be04f07f9fdc005b620053ae4f09dd1e27ebb3' and '582755b8228024381c2a9e110de35f0aaedd5dc1'
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 02 Jul 2008 00:06:25 +0000
parents aa6395907702
children b5f679e95666 9ffbfbcf307d
comparison
equal deleted inserted replaced
22773:c9bc2d0215ed 23404:3c1f1bed5be2
41 #include "prefs.h" 41 #include "prefs.h"
42 #include "privacy.h" 42 #include "privacy.h"
43 #include "proxy.h" 43 #include "proxy.h"
44 #include "savedstatuses.h" 44 #include "savedstatuses.h"
45 #include "signals.h" 45 #include "signals.h"
46 #include "smiley.h"
46 #include "sound.h" 47 #include "sound.h"
47 #include "sslconn.h" 48 #include "sslconn.h"
48 #include "status.h" 49 #include "status.h"
49 #include "stun.h" 50 #include "stun.h"
50 #include "util.h" 51 #include "util.h"
85 #endif 86 #endif
86 #ifdef _WIN32 87 #ifdef _WIN32
87 wpurple_init(); 88 wpurple_init();
88 #endif 89 #endif
89 90
91 g_type_init();
92
90 _core = core = g_new0(PurpleCore, 1); 93 _core = core = g_new0(PurpleCore, 1);
91 core->ui = g_strdup(ui); 94 core->ui = g_strdup(ui);
92 core->reserved = NULL; 95 core->reserved = NULL;
93 96
94 ops = purple_core_get_ui_ops(); 97 ops = purple_core_get_ui_ops();
126 purple_dbus_init(); 129 purple_dbus_init();
127 #endif 130 #endif
128 131
129 purple_ciphers_init(); 132 purple_ciphers_init();
130 133
131 /* Initialize all static protocols. */
132 static_proto_init();
133
134 /* Since plugins get probed so early we should probably initialize their 134 /* Since plugins get probed so early we should probably initialize their
135 * subsystem right away too. 135 * subsystem right away too.
136 */ 136 */
137 purple_plugins_init(); 137 purple_plugins_init();
138
139 /* Initialize all static protocols. */
140 static_proto_init();
141
138 purple_plugins_probe(G_MODULE_SUFFIX); 142 purple_plugins_probe(G_MODULE_SUFFIX);
139 143
140 /* The buddy icon code uses the imgstore, so init it early. */ 144 /* The buddy icon code uses the imgstore, so init it early. */
141 purple_imgstore_init(); 145 purple_imgstore_init();
142 146
162 purple_sound_init(); 166 purple_sound_init();
163 purple_ssl_init(); 167 purple_ssl_init();
164 purple_stun_init(); 168 purple_stun_init();
165 purple_xfers_init(); 169 purple_xfers_init();
166 purple_idle_init(); 170 purple_idle_init();
171 purple_smileys_init();
167 172
168 /* 173 /*
169 * Call this early on to try to auto-detect our IP address and 174 * Call this early on to try to auto-detect our IP address and
170 * hopefully save some time later. 175 * hopefully save some time later.
171 */ 176 */
190 195
191 /* Transmission ends */ 196 /* Transmission ends */
192 purple_connections_disconnect_all(); 197 purple_connections_disconnect_all();
193 198
194 /* Save .xml files, remove signals, etc. */ 199 /* Save .xml files, remove signals, etc. */
200 purple_smileys_uninit();
195 purple_idle_uninit(); 201 purple_idle_uninit();
196 purple_ssl_uninit(); 202 purple_ssl_uninit();
197 purple_pounces_uninit(); 203 purple_pounces_uninit();
198 purple_blist_uninit(); 204 purple_blist_uninit();
199 purple_ciphers_uninit(); 205 purple_ciphers_uninit();
204 purple_buddy_icons_uninit(); 210 purple_buddy_icons_uninit();
205 purple_accounts_uninit(); 211 purple_accounts_uninit();
206 purple_savedstatuses_uninit(); 212 purple_savedstatuses_uninit();
207 purple_status_uninit(); 213 purple_status_uninit();
208 purple_prefs_uninit(); 214 purple_prefs_uninit();
215 purple_sound_uninit();
209 purple_xfers_uninit(); 216 purple_xfers_uninit();
210 purple_proxy_uninit(); 217 purple_proxy_uninit();
211 purple_dnsquery_uninit(); 218 purple_dnsquery_uninit();
212 purple_imgstore_uninit(); 219 purple_imgstore_uninit();
213 220
215 purple_plugins_destroy_all(); 222 purple_plugins_destroy_all();
216 223
217 ops = purple_core_get_ui_ops(); 224 ops = purple_core_get_ui_ops();
218 if (ops != NULL && ops->quit != NULL) 225 if (ops != NULL && ops->quit != NULL)
219 ops->quit(); 226 ops->quit();
220
221 /*
222 * purple_sound_uninit() should be called as close to
223 * shutdown as possible. This is because the call
224 * to ao_shutdown() can sometimes leave our
225 * environment variables in an unusable state, which
226 * can cause a crash when getenv is called (by gettext
227 * for example). See the complete bug report at
228 * http://trac.xiph.org/cgi-bin/trac.cgi/ticket/701
229 *
230 * TODO: Eventually move this call higher up with the others.
231 */
232 purple_sound_uninit();
233 227
234 purple_plugins_uninit(); 228 purple_plugins_uninit();
235 #ifdef HAVE_DBUS 229 #ifdef HAVE_DBUS
236 purple_dbus_uninit(); 230 purple_dbus_uninit();
237 #endif 231 #endif