summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-06-26 13:16:09 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-06-26 13:27:32 +0200
commit34dd52adffbebc28d391a222530aa29e8df59873 (patch)
treeb501cf756d8c2edf0fb8b4a7ba400e0c923afe69 /kopete/protocols/jabber
parent509a3cfb67078d33028c276cee865f41b847f9f3 (diff)
downloadtdenetwork-34dd52adffbebc28d391a222530aa29e8df59873.tar.gz
tdenetwork-34dd52adffbebc28d391a222530aa29e8df59873.zip
Fix threads initialization in kopete libjingle
[taken from FreeBSD kopete patches]
Diffstat (limited to 'kopete/protocols/jabber')
-rw-r--r--kopete/protocols/jabber/jingle/libjingle/talk/base/criticalsection.h2
-rw-r--r--kopete/protocols/jabber/jingle/libjingle/talk/base/thread.cc1
-rw-r--r--kopete/protocols/jabber/jingle/libjingle/talk/session/phone/linphonemediaengine.cc1
3 files changed, 4 insertions, 0 deletions
diff --git a/kopete/protocols/jabber/jingle/libjingle/talk/base/criticalsection.h b/kopete/protocols/jabber/jingle/libjingle/talk/base/criticalsection.h
index 145ceba1..fe976322 100644
--- a/kopete/protocols/jabber/jingle/libjingle/talk/base/criticalsection.h
+++ b/kopete/protocols/jabber/jingle/libjingle/talk/base/criticalsection.h
@@ -83,8 +83,10 @@ class CriticalSection {
public:
CriticalSection() {
pthread_mutexattr_t mutex_attribute;
+ pthread_mutexattr_init(&mutex_attribute);
pthread_mutexattr_settype(&mutex_attribute, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex_, &mutex_attribute);
+ pthread_mutexattr_destroy(&mutex_attribute);
}
~CriticalSection() {
pthread_mutex_destroy(&mutex_);
diff --git a/kopete/protocols/jabber/jingle/libjingle/talk/base/thread.cc b/kopete/protocols/jabber/jingle/libjingle/talk/base/thread.cc
index 8f18a992..b189e621 100644
--- a/kopete/protocols/jabber/jingle/libjingle/talk/base/thread.cc
+++ b/kopete/protocols/jabber/jingle/libjingle/talk/base/thread.cc
@@ -113,6 +113,7 @@ void Thread::Start() {
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create(&thread_, &attr, PreLoop, this);
+ pthread_attr_destroy(&attr);
started_ = true;
}
diff --git a/kopete/protocols/jabber/jingle/libjingle/talk/session/phone/linphonemediaengine.cc b/kopete/protocols/jabber/jingle/libjingle/talk/session/phone/linphonemediaengine.cc
index d9cf2a94..756456d3 100644
--- a/kopete/protocols/jabber/jingle/libjingle/talk/session/phone/linphonemediaengine.cc
+++ b/kopete/protocols/jabber/jingle/libjingle/talk/session/phone/linphonemediaengine.cc
@@ -66,6 +66,7 @@ LinphoneMediaChannel::LinphoneMediaChannel() {
pthread_attr_init(&attr);
pthread_create(&thread_, &attr, &thread_function, this);
+ pthread_attr_destroy(&attr);
}
LinphoneMediaChannel::~LinphoneMediaChannel() {