summaryrefslogtreecommitdiff
blob: 0d2a2c9e520b7ae03d7808bb19551de1d3ca55eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff -u -u kdevelop-3.4.1/languages/cpp/cppsupportpart.cpp kdevelop-svn/languages/cpp/cppsupportpart.cpp
--- kdevelop-3.4.1/languages/cpp/cppsupportpart.cpp	2007-05-16 16:36:20.000000000 +0200
+++ kdevelop-svn/languages/cpp/cppsupportpart.cpp	2007-05-16 00:25:57.000000000 +0200
@@ -3130,11 +3130,11 @@
         return QString::null;
 }
 
-UIBlockTester::UIBlockTesterThread::UIBlockTesterThread( UIBlockTester& parent ) : QThread(), m_parent( parent ) {
+UIBlockTester::UIBlockTesterThread::UIBlockTesterThread( UIBlockTester& parent ) : QThread(), m_parent( parent ), m_stop(false) {
 }
       
 void UIBlockTester::UIBlockTesterThread::run() {
-  while(1) {
+  while(!m_stop) {
 	  msleep( m_parent.m_msecs / 10 );
 	  m_parent.m_timeMutex.lock();
 	  QDateTime t = QDateTime::currentDateTime();
@@ -3146,7 +3146,11 @@
 	  m_parent.m_timeMutex.unlock();
   }
 }
-      
+
+void UIBlockTester::UIBlockTesterThread::stop() {
+	m_stop = true;
+}
+
 UIBlockTester::UIBlockTester( uint milliseconds ) : m_thread( *this ), m_msecs( milliseconds ) {
 	m_timer = new QTimer( this );
 	m_timer->start( milliseconds/10 );
@@ -3155,7 +3159,7 @@
 	m_thread.start();
 }
 UIBlockTester::~UIBlockTester() {
-  m_thread.terminate();
+  m_thread.stop();
   m_thread.wait();
 }
 	
diff -u -u kdevelop-3.4.1/languages/cpp/cppsupportpart.h kdevelop-svn/languages/cpp/cppsupportpart.h
--- kdevelop-3.4.1/languages/cpp/cppsupportpart.h	2007-05-16 16:36:20.000000000 +0200
+++ kdevelop-svn/languages/cpp/cppsupportpart.h	2007-05-16 00:25:57.000000000 +0200
@@ -43,9 +43,10 @@
     public:
       UIBlockTesterThread( UIBlockTester& parent );
       void run();
-      
+      void stop();
     private:
       UIBlockTester& m_parent;
+      bool m_stop;
     };
   friend class UIBlockTesterThread;
 public: