summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-31 13:37:41 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-31 13:56:14 -0700
commit45767961e88c85eb3bf3f8cbff1c9c675eca4904 (patch)
tree8eb886b9b27cdde46fa84cd699ffa0438e57f243 /main.cpp
parent02d5d436d2b634f2bdf9d4666b7c416ab8315e2b (diff)
downloadsubsurface-45767961e88c85eb3bf3f8cbff1c9c675eca4904.tar.gz
Fix crash with libgit when it's compiled with GIT_THREADS
Call git_threads_init() before using libgit functions. The documentation says: "If libgit2 has been built with GIT_THREADS on, this function must be called once before any other library functions. If libgit2 has been built without GIT_THREADS support, this function is a no-op" Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index a011b4caf..fd4822324 100644
--- a/main.cpp
+++ b/main.cpp
@@ -11,6 +11,7 @@
#include "qt-ui/diveplanner.h"
#include <QStringList>
+#include <git2.h>
QTranslator *qtTranslator, *ssrfTranslator;
@@ -41,6 +42,7 @@ int main(int argc, char **argv)
files.push_back(a);
}
}
+ git_threads_init();
setup_system_prefs();
prefs = default_prefs;
fill_profile_color();