moved more objects to shared ptrs

This commit is contained in:
itsmattkc
2019-08-09 08:21:54 +10:00
parent dfd33310a2
commit f26eea1620
12 changed files with 33 additions and 28 deletions
+2 -3
View File
@@ -50,7 +50,7 @@ void RendererProcessor::Start()
threads_.resize(QThread::idealThreadCount());
for (int i=0;i<threads_.size();i++) {
threads_[i] = new RendererThread();
threads_[i] = std::make_shared<RendererThread>();
threads_[i]->run();
}
@@ -67,13 +67,12 @@ void RendererProcessor::Stop()
for (int i=0;i<threads_.size();i++) {
threads_[i]->Cancel();
delete threads_[i];
}
threads_.clear();
}
RendererThread *RendererProcessor::CurrentThread()
RendererThread* RendererProcessor::CurrentThread()
{
return dynamic_cast<RendererThread*>(QThread::currentThread());
}