Comments (7)
不会死循环啊。如果窗口还没打开就异步关闭。
from awtk.
异步关闭是指idle的回调函数吗,因为我这里遇到一个awtk卡死的问题,最后看coredump结果是卡在这一行,而且复现的概率比较低,我想知道如果窗口还没有打开的话,进入到这个分支,然后idle定时器的回调函数还是调用的window_manager_close_window函数,这中间没有其他处理,是不是会一直循环下去?
static ret_t window_manager_default_on_idle_check_and_close_window(const idle_info_t* idle) {
widget_t* win = WIDGET(idle->ctx);
window_manager_close_window(window_manager(), win);
return RET_REPEAT;
}
from awtk.
方便的话,你弄个可以重现的demo给我看看。
from awtk.
我这里也就复现了两次,看上去都和close_all 有关,代码是参考的window_manager_close_all这个函数,但是把里面的window_manager_close_window_force改成window_close(win) 类似于下面这样
ret_t window_manager_close_all(widget_t* widget) {
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
do {
uint32_t nr = widget_count_children(widget);
if (nr > 0) {
widget_t* win = widget_get_child(widget, nr - 1);
window_close(win);
} else {
break;
}
} while (TRUE);
return RET_OK;
}
功能就是将之前的页面关闭然后打开新的页面,在点击按钮关闭的时候就有很小的概率会陷入死循环
我手动生成coredump后发现调用栈卡在这一行,看awtk源码后分析觉得可能是在window_manager_default_close_window这里面
if (!window_is_opened(window))这个条件成立了,但是没找到必现的方法,然后我看代码如果走进这个分支的话好像是会陷入死循环,尝试将if (!window_is_opened(window))这个条件改成ture,然后运行发现就是不停在idle里面回调卡死
from awtk.
正常情况下,关闭还没有打开的窗口,第一次关闭失败,第二次会关闭成功,窗口被销毁,然后窗口相关的idle都会被移除掉,不会进入死循环。
from awtk.
我改了一下,你更新试试,谢谢。
from awtk.
我昨天找到了必现方法,很抱歉是我之前的猜想是错误的,谢谢您帮忙跟进,卡死的原因是在do while循环里面不停地获取第一个elms, 然而调用window close 函数走到if (!window_is_opened(window))这个分支的时候,实际新窗口已经load上 ,但是状态还没到下一个主循环,所以状态还是WINDOW_STAGE_LOADED,这个时候会走到if (!window_is_opened(window))这个分支里面,然后不停的加idle定时器,实际是当前主循环一直卡死,没有走到下一个idle dispatch, 我当前的解决办法是修改window_is_opened(window)函数,放宽window_is_open的判断条件:具体修改如下:
static bool_t window_is_opened(widget_t* widget) {
int32_t stage = widget_get_prop_int(widget, WIDGET_PROP_STAGE, WINDOW_STAGE_NONE);
return stage != WINDOW_STAGE_CLOSED && stage != WINDOW_STAGE_NONE;
}
验证好像没有问题,不知道这样改会不会有什么隐患,请帮忙评估一下
from awtk.
Related Issues (20)
- 能否提供Rust语言的绑定 HOT 2
- 一个页面带有gif控件,关闭这个页面时,有时在屏幕留下残影 HOT 11
- gif problem
- AttributeError: 'tuple' object has no attribute 'lower'
- 最新版本按键功能异常 HOT 8
- mledit显示文本问题,属性 字体设置为非默认字体时, 失去焦点字才能显示?
- 发生较难排查的偶现奔溃时,awtk有提供什么好的排查方式吗 HOT 1
- 页面提示找不到view_model HOT 3
- 获取不到开启auto_adjust_size属性的label控件高度 HOT 1
- freetype渲染有点问题,truetype内置的bitmap字体数字和字母渲染不正常,中文正常。矢量字体全部正常 HOT 1
- dialog_toast短暂提示信息是否支持弹窗期间收到按键行为自动退出 HOT 6
- Incorrect format specifier HOT 1
- Missing null check HOT 3
- button长按之后松开,pointer_up事件偶尔不触发 HOT 3
- awtk-web怎样实现模态显示对话框?
- BX_REALLOC not declared in this scope HOT 2
- l
- preview_ui.exe 不识别default字体,需要手动移植default_full字体才显示
- 运行awtk项目电阻屏触摸与坐标不符,tslib测试没有问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awtk.