Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
6fff7f0c
A
anbox
项目概览
openeuler
/
anbox
通知
24
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
anbox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6fff7f0c
编写于
9月 08, 2020
作者:
W
wangpeiqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
window: solve crash problem.
Set destroy window in single function, to make window destroyed in message cycle thread.
上级
03940be6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
4 deletion
+17
-4
src/anbox/platform/sdl/platform.cpp
src/anbox/platform/sdl/platform.cpp
+8
-2
src/anbox/platform/sdl/window.cpp
src/anbox/platform/sdl/window.cpp
+7
-2
src/anbox/platform/sdl/window.h
src/anbox/platform/sdl/window.h
+1
-0
src/anbox/wm/window.h
src/anbox/wm/window.h
+1
-0
未找到文件。
src/anbox/platform/sdl/platform.cpp
浏览文件 @
6fff7f0c
...
...
@@ -298,11 +298,17 @@ void Platform::user_event_function(const SDL_Event &event) {
window_manager_
->
remove_task
(
param
->
taskId
);
}
}
else
if
(
event_type
==
USER_DESTROY_WINDOW
)
{
{
auto
w
=
window_manager_
->
find_window_for_task
(
param
->
taskId
);
if
(
w
)
{
w
->
destroy_window
();
}
}
window_manager_
->
erase_task
(
param
->
taskId
);
auto
it
=
tasks_
.
find
(
param
->
taskId
);
if
(
it
!=
tasks_
.
end
())
{
windows_
.
erase
(
it
->
second
);
tasks_
.
erase
(
it
);
windows_
.
erase
(
it
->
second
);
tasks_
.
erase
(
it
);
}
}
delete
param
;
...
...
src/anbox/platform/sdl/window.cpp
浏览文件 @
6fff7f0c
...
...
@@ -152,8 +152,13 @@ Window::Window(const std::shared_ptr<Renderer> &renderer,
SDL_ShowWindow
(
window_
);
}
Window
::~
Window
()
{
if
(
window_
)
SDL_DestroyWindow
(
window_
);
Window
::~
Window
()
{}
void
Window
::
destroy_window
()
{
if
(
window_
)
{
SDL_DestroyWindow
(
window_
);
window_
=
NULL
;
}
}
bool
Window
::
title_event_filter
(
int
x
,
int
y
)
{
...
...
src/anbox/platform/sdl/window.h
浏览文件 @
6fff7f0c
...
...
@@ -90,6 +90,7 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
inline
std
::
uint32_t
get_property
()
{
return
visible_property
;
}
void
destroy_window
()
override
;
private:
static
SDL_HitTestResult
on_window_hit
(
SDL_Window
*
window
,
const
SDL_Point
*
pt
,
void
*
data
);
...
...
src/anbox/wm/window.h
浏览文件 @
6fff7f0c
...
...
@@ -65,6 +65,7 @@ class Window {
std
::
string
title
()
const
;
virtual
bool
checkResizeable
()
{
return
resizing_
;
}
virtual
void
setResizing
(
bool
resizing
)
{
resizing_
=
resizing
;
}
virtual
void
destroy_window
()
{}
protected:
graphics
::
Rect
last_frame_
;
bool
resizing_
{
false
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录