fix mac RTL and app termination deadlock

This commit is contained in:
2019-04-07 11:27:43 +02:00
parent 3611057f18
commit ada1afbac2
4 changed files with 13 additions and 10 deletions

View File

@@ -220,10 +220,8 @@ std::mutex task_mutex;
- (void)terminateGL - (void)terminateGL
{ {
CGLLockContext([[self openGLContext] CGLContextObj]);
App::I.terminate();
CGLUnlockContext([[self openGLContext] CGLContextObj]);
CVDisplayLinkRelease(dl); CVDisplayLinkRelease(dl);
App::I.terminate();
} }
// This is the renderer output callback function // This is the renderer output callback function

View File

@@ -1634,7 +1634,7 @@ Here's a list of what's available in this release.
</node> </node>
</border> </border>
<!-- toolbar --> <!-- toolbar -->
<border id="toolbar" height="50" width="100%" pad="5" dir="row" color="0 0 0 0.6" mouse-capture="true"> <border id="toolbar" height="50" width="100%" pad="5" dir="row" color="0 0 0 0.6" mouse-capture="true" rtl="ltr">
<!-- <!--
<button id="btn-open" width="50" height="100%" margin="0 5 0 0" text="Open"/> <button id="btn-open" width="50" height="100%" margin="0 5 0 0" text="Open"/>
<button id="btn-save" width="50" height="100%" margin="0 5 0 0" text="Save"/> <button id="btn-save" width="50" height="100%" margin="0 5 0 0" text="Save"/>
@@ -1736,17 +1736,17 @@ Here's a list of what's available in this release.
</node> </node>
</border> </border>
<scroll id="drop-left" color="0 0 0 .6" min-width="10" mouse-capture="true"/> <scroll id="drop-left" color="0 0 0 .6" min-width="10" mouse-capture="true" rtl="ltr"/>
<!--quick bar--> <!--quick bar-->
<node justify="center" align="center" dir="col"> <node justify="center" align="center" dir="col" rtl="ltr">
<panel-quick id="panel-quick"/> <panel-quick id="panel-quick"/>
<node height="0" grow="1" max-height="50"/> <node height="0" grow="1" max-height="50"/>
</node> </node>
<node id="floatings" color="0 0 0 1" width="1" grow="1" height="100%"/> <node id="floatings" color="0 0 0 1" width="1" grow="1" height="100%" rtl="ltr"/>
<scroll id="drop-right" color="0 0 0 .6" min-width="10" mouse-capture="true"/> <scroll id="drop-right" color="0 0 0 .6" min-width="10" mouse-capture="true" rtl="ltr"/>
<!-- timeline --> <!-- timeline -->
<!-- <!--

View File

@@ -679,6 +679,9 @@ void App::terminate()
{ {
LOG("App::terminate"); LOG("App::terminate");
NodeStrokePreview::terminate_renderer(); NodeStrokePreview::terminate_renderer();
rec_stop();
async_start();
TextureManager::invalidate(); TextureManager::invalidate();
ShaderManager::invalidate(); ShaderManager::invalidate();
layout.unload(); layout.unload();
@@ -693,7 +696,7 @@ void App::terminate()
floating_color.reset(); floating_color.reset();
floating_layers.reset(); floating_layers.reset();
floating_picker.reset(); floating_picker.reset();
rec_stop(); async_end();
} }
void App::update_memory_usage(size_t bytes) void App::update_memory_usage(size_t bytes)
@@ -787,7 +790,9 @@ void App::rec_stop()
rec_cv.notify_all(); rec_cv.notify_all();
if (rec_thread.joinable()) if (rec_thread.joinable())
rec_thread.join(); rec_thread.join();
async_start();
update_rec_frames(); update_rec_frames();
async_end();
} }
} }

View File

@@ -921,7 +921,7 @@ void App::init_menu_experimental()
}; };
rtl_btn->find<NodeCheckBox>("experimental-rtl-check")->on_value_changed = [this, main](Node*, bool checked) rtl_btn->find<NodeCheckBox>("experimental-rtl-check")->on_value_changed = [this, main](Node*, bool checked)
{ {
auto ui = main->find("ui-root"); auto ui = main->find("central-row");
ui->SetRTL(checked ? YGDirectionRTL : YGDirectionLTR); ui->SetRTL(checked ? YGDirectionRTL : YGDirectionLTR);
}; };
} }