comparison Applications/BasicApplicationContext.cpp @ 61:ca644004d2ee wasm

MAJOR - removal of Start/Stop and observers in IWidget
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 May 2017 17:55:13 +0200
parents d20e25cfcf3a
children a4497c6449df
comparison
equal deleted inserted replaced
60:288c948199e5 61:ca644004d2ee
30 void BasicApplicationContext::UpdateThread(BasicApplicationContext* that) 30 void BasicApplicationContext::UpdateThread(BasicApplicationContext* that)
31 { 31 {
32 while (!that->stopped_) 32 while (!that->stopped_)
33 { 33 {
34 { 34 {
35 printf("GOSH\n"); fflush(stdout);
35 ViewportLocker locker(*that); 36 ViewportLocker locker(*that);
36 locker.GetViewport().UpdateContent(); 37 locker.GetViewport().UpdateContent();
37 } 38 }
38 39
39 boost::this_thread::sleep(boost::posix_time::milliseconds(that->updateDelay_)); 40 boost::this_thread::sleep(boost::posix_time::milliseconds(that->updateDelay_));
134 { 135 {
135 assert(*it != NULL); 136 assert(*it != NULL);
136 (*it)->Start(); 137 (*it)->Start();
137 } 138 }
138 139
139 viewport_.Start();
140
141 if (viewport_.HasUpdateContent()) 140 if (viewport_.HasUpdateContent())
142 { 141 {
143 stopped_ = false; 142 stopped_ = false;
144 updateThread_ = boost::thread(UpdateThread, this); 143 updateThread_ = boost::thread(UpdateThread, this);
145 } 144 }
153 if (updateThread_.joinable()) 152 if (updateThread_.joinable())
154 { 153 {
155 updateThread_.join(); 154 updateThread_.join();
156 } 155 }
157 156
158 viewport_.Stop();
159
160 for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it) 157 for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it)
161 { 158 {
162 assert(*it != NULL); 159 assert(*it != NULL);
163 (*it)->Stop(); 160 (*it)->Stop();
164 } 161 }