Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
ece98584
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ece98584
编写于
2月 16, 2021
作者:
M
Matej Knopp
提交者:
GitHub
2月 16, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Unblock FlutterResizeSynchronizer on engine shutdown (#24264)
上级
6993cb22
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
34 addition
and
5 deletion
+34
-5
shell/platform/darwin/macos/framework/Source/FlutterEngine.mm
...l/platform/darwin/macos/framework/Source/FlutterEngine.mm
+4
-0
shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.h
...darwin/macos/framework/Source/FlutterResizeSynchronizer.h
+5
-0
shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.mm
...arwin/macos/framework/Source/FlutterResizeSynchronizer.mm
+15
-5
shell/platform/darwin/macos/framework/Source/FlutterView.h
shell/platform/darwin/macos/framework/Source/FlutterView.h
+6
-0
shell/platform/darwin/macos/framework/Source/FlutterView.mm
shell/platform/darwin/macos/framework/Source/FlutterView.mm
+4
-0
未找到文件。
shell/platform/darwin/macos/framework/Source/FlutterEngine.mm
浏览文件 @
ece98584
...
...
@@ -489,6 +489,10 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi
return
;
}
if
(
_viewController
&&
_viewController
.
flutterView
)
{
[
_viewController
.
flutterView
shutdown
];
}
FlutterEngineResult
result
=
_embedderAPI
.
Deinitialize
(
_engine
);
if
(
result
!=
kSuccess
)
{
NSLog
(
@"Could not de-initialize the Flutter engine: error %d"
,
result
);
...
...
shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.h
浏览文件 @
ece98584
...
...
@@ -75,4 +75,9 @@
*/
-
(
void
)
requestCommit
;
/**
* Called when shutting down. Unblocks everything and prevents any further synchronization.
*/
-
(
void
)
shutdown
;
@end
shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.mm
浏览文件 @
ece98584
...
...
@@ -34,6 +34,9 @@
// Target size for resizing.
CGSize
_newSize
;
// if YES prevents all synchronization
BOOL
_shuttingDown
;
__weak
id
<
FlutterResizeSynchronizerDelegate
>
_delegate
;
}
@end
...
...
@@ -54,7 +57,7 @@
return
;
}
if
(
!
_receivedFirstFrame
)
{
if
(
!
_receivedFirstFrame
||
_shuttingDown
)
{
// No blocking until framework produces at least one frame
notify
();
return
;
...
...
@@ -77,7 +80,7 @@
_waiting
=
YES
;
_condBlockRequestCommit
.
wait
(
lock
,
[
&
]
{
return
_pendingCommit
;
});
_condBlockRequestCommit
.
wait
(
lock
,
[
&
]
{
return
_pendingCommit
||
_shuttingDown
;
});
[
_delegate
resizeSynchronizerFlush
:
self
];
[
_delegate
resizeSynchronizerCommit
:
self
];
...
...
@@ -104,7 +107,7 @@
-
(
void
)
requestCommit
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
_mutex
);
if
(
!
_acceptingCommit
)
{
if
(
!
_acceptingCommit
||
_shuttingDown
)
{
return
;
}
...
...
@@ -113,7 +116,7 @@
_pendingCommit
=
YES
;
if
(
_waiting
)
{
// BeginResize is in progress, interrupt it and schedule commit call
_condBlockRequestCommit
.
notify_all
();
_condBlockBeginResize
.
wait
(
lock
,
[
&
]()
{
return
!
_pendingCommit
;
});
_condBlockBeginResize
.
wait
(
lock
,
[
&
]()
{
return
!
_pendingCommit
||
_shuttingDown
;
});
}
else
{
// No resize, schedule commit on platform thread and wait until either done
// or interrupted by incoming BeginResize
...
...
@@ -128,8 +131,15 @@
_condBlockBeginResize
.
notify_all
();
}
});
_condBlockBeginResize
.
wait
(
lock
,
[
&
]()
{
return
!
_pendingCommit
;
});
_condBlockBeginResize
.
wait
(
lock
,
[
&
]()
{
return
!
_pendingCommit
||
_shuttingDown
;
});
}
}
-
(
void
)
shutdown
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
_mutex
);
_shuttingDown
=
YES
;
_condBlockBeginResize
.
notify_all
();
_condBlockRequestCommit
.
notify_all
();
}
@end
shell/platform/darwin/macos/framework/Source/FlutterView.h
浏览文件 @
ece98584
...
...
@@ -56,4 +56,10 @@
*/
-
(
nonnull
FlutterRenderBackingStore
*
)
backingStoreForSize
:(
CGSize
)
size
;
/**
* Must be called when shutting down. Unblocks raster thread and prevents any further
* synchronization.
*/
-
(
void
)
shutdown
;
@end
shell/platform/darwin/macos/framework/Source/FlutterView.mm
浏览文件 @
ece98584
...
...
@@ -124,4 +124,8 @@
[
_reshapeListener
viewDidReshape
:
self
];
}
-
(
void
)
shutdown
{
[
_resizeSynchronizer
shutdown
];
}
@end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录