disable multithread on iOS

This commit is contained in:
2019-02-28 23:28:25 +01:00
parent 080a306cc6
commit 44ca908c6d
2 changed files with 38 additions and 0 deletions

View File

@@ -1176,6 +1176,10 @@ void Canvas::clear_context()
void Canvas::import_equirectangular(std::string file_path)
{
#if __IOS__
import_equirectangular_thread(file_path);
return;
#endif
std::thread t(&Canvas::import_equirectangular_thread, this, file_path);
t.detach();
}
@@ -1249,6 +1253,12 @@ void Canvas::export_equirectangular(std::string file_path, std::function<void()>
{
if (App::I.check_license())
{
#if __IOS__
export_equirectangular_thread(file_path);
if (on_complete)
on_complete();
return;
#endif
std::thread t([=] {
export_equirectangular_thread(file_path);
if (on_complete)
@@ -1553,6 +1563,12 @@ void Canvas::export_layers(std::string file_name, std::function<void()> on_compl
{
if (App::I.check_license())
{
#if __IOS__
export_layers_thread(file_name);
if (on_complete)
on_complete();
return;
#endif
std::thread t([=] {
export_layers_thread(file_name);
if (on_complete)
@@ -1808,6 +1824,12 @@ void Canvas::project_save(std::function<void(bool)> on_complete)
{
if (App::I.check_license())
{
#if __IOS__
bool ret = project_save_thread(App::I.doc_path);
if (on_complete)
on_complete(ret);
return;
#endif
std::thread t([=] {
bool ret = project_save_thread(App::I.doc_path);
if (on_complete)
@@ -1822,6 +1844,12 @@ void Canvas::project_save(std::string file_path, std::function<void(bool)> on_co
LOG("saving %s", file_path.c_str());
if (App::I.check_license())
{
#if __IOS__
bool ret = project_save_thread(file_path);
if (on_complete)
on_complete(ret);
return;
#endif
std::thread t([=] {
bool ret = project_save_thread(file_path);
if (on_complete)
@@ -2018,6 +2046,12 @@ bool Canvas::project_save_thread(std::string file_path)
void Canvas::project_open(std::string file_path, std::function<void(bool)> on_complete)
{
#if __IOS__
bool ret = project_open_thread(file_path);
if (on_complete)
on_complete(ret);
return;
#endif
std::thread t([=] {
bool result = project_open_thread(file_path);
if (on_complete)

View File

@@ -477,6 +477,10 @@ void NodeStrokePreview::draw_stroke()
{
if (m_size.x == 0 || m_size.y == 0)
return;
#if __IOS__
draw_stroke_immediate();
return;
#endif
s_queue.mutex.lock();
if (!s_running)
{