Fix Cycles viewport render doing some unnecessary work at the start.
In some cases it would load adaptive kernels or even start rendering twice because the first time the scene was not fully synced yet.
This commit is contained in:
@@ -129,7 +129,9 @@ Session::~Session()
|
||||
|
||||
void Session::start()
|
||||
{
|
||||
session_thread = new thread(function_bind(&Session::run, this));
|
||||
if (!session_thread) {
|
||||
session_thread = new thread(function_bind(&Session::run, this));
|
||||
}
|
||||
}
|
||||
|
||||
bool Session::ready_to_reset()
|
||||
@@ -830,8 +832,10 @@ void Session::set_pause(bool pause_)
|
||||
|
||||
void Session::wait()
|
||||
{
|
||||
session_thread->join();
|
||||
delete session_thread;
|
||||
if (session_thread) {
|
||||
session_thread->join();
|
||||
delete session_thread;
|
||||
}
|
||||
|
||||
session_thread = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user