summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-08-28 12:51:25 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-08-28 12:51:25 (GMT)
commit4d9d6d7148c8ff271d67196874c15d4b7ccef869 (patch)
treeea798720db4bcebf26415b23b0db8ddaa7a3633b /Swiften/Network/GConfProxyProvider.cpp
parent730b88ce48471842333b8769bcfc017335b0440f (diff)
downloadswift-contrib-4d9d6d7148c8ff271d67196874c15d4b7ccef869.zip
swift-contrib-4d9d6d7148c8ff271d67196874c15d4b7ccef869.tar.bz2
Call g_type_init before using gconf.
Resolves: #957
Diffstat (limited to 'Swiften/Network/GConfProxyProvider.cpp')
-rw-r--r--Swiften/Network/GConfProxyProvider.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Swiften/Network/GConfProxyProvider.cpp b/Swiften/Network/GConfProxyProvider.cpp
index 26de4d8..8d97c68 100644
--- a/Swiften/Network/GConfProxyProvider.cpp
+++ b/Swiften/Network/GConfProxyProvider.cpp
@@ -16,6 +16,13 @@
namespace Swift {
GConfProxyProvider::GConfProxyProvider() {
+ // Ensure static GLib initialization methods are called
+ static bool glibInitialized = false;
+ if (!glibInitialized) {
+ g_type_init();
+ glibInitialized = true;
+ }
+
socksProxy = getFromGConf("/system/proxy/socks_host", "/system/proxy/socks_port");
httpProxy = getFromGConf("/system/http_proxy/host", "/system/http_proxy/port");
SWIFT_LOG(debug) << "GConf: SOCKS5 => " << socksProxy.toString() << "; HTTP Connect => " << httpProxy.toString() << std::endl;