equal
deleted
inserted
replaced
507 g_free(l); |
507 g_free(l); |
508 } |
508 } |
509 |
509 |
510 static void jingle_socks5_init(void) |
510 static void jingle_socks5_init(void) |
511 { |
511 { |
512 g_type_init(); |
512 // ugly hack to fix the segfault when quitting: |
|
513 // mcabber doesn't load gthread or gobject but they are required by gio, |
|
514 // and cannot be unloaded once they are loaded or a segfault occur. |
|
515 // We dlopen gio with global | nodelete flags. This will also load gobject |
|
516 // and gthread as dependencies. g_type_init will init gobject/gthread (and |
|
517 // set threads_got_initialized to true). |
|
518 if (g_threads_got_initialized == FALSE) { |
|
519 void *dlopen(const char *filename, int flag); |
|
520 // RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE |
|
521 dlopen("libgio-2.0.so", 0x00001 | 0x00100 | 0x01000); |
|
522 g_type_init(); |
|
523 } |
513 jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs, |
524 jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs, |
514 JINGLE_TRANSPORT_STREAMING, |
525 JINGLE_TRANSPORT_STREAMING, |
515 JINGLE_TRANSPORT_PRIO_HIGH); |
526 JINGLE_TRANSPORT_PRIO_HIGH); |
516 xmpp_add_feature(NS_JINGLE_TRANSPORT_SOCKS5); |
527 xmpp_add_feature(NS_JINGLE_TRANSPORT_SOCKS5); |
517 local_ips = get_all_local_ips(); |
528 local_ips = get_all_local_ips(); |