slint
slint copied to clipboard
Panic when parent of PopupWindow is destroyed: called `Option::unwrap()` on a `None` value
slint 1.4.1 when I called PopupWindow. close(), the program panic! I am using third-party components jui/message/confirm at that time,
- a thread was changing global properties, see code
- I click jui/confirm components to close PopupWindow, and then the program panic!
- see panic! code
this issue like: #4500
add issue description
- I did not use or install qt, I guess it's the default rendering(femtovg or software)
Thanks for the report. Do you have some .slint code around that could help us reproduce this?
Thanks for the report. Do you have some .slint code around that could help us reproduce this?
yes, I reproduced this question, y can see jui_test example
now I think this may not be a bug, but a problem with the logic of my code
Thanks for the report. Do you have some .slint code around that could help us reproduce this?
Supplementary explanation
- when testing jui_test, I also found that as long as PopupWindow is opened and the global variable TestGlobal is changed, the jui_test program will painc!
- so now I think this may be a bug, because the business logic may change the rendering of components when PopupWindow is displayed, but if we can avoid changing the rendering of PopupWindow components, this issue will not occur
Thanks for all the info. This is actually a variant of https://github.com/slint-ui/slint/issues/3464 which is enabled by the PopupWindow. In your example, the parent component of a PopupWindow is destroyed by a timer. but the PopupWindow still exists.
A simpler reproducer is this:
export component Demo {
in property <string> text : "Hello";
in-out property <bool> cond:true;
if cond : Rectangle {
p := PopupWindow {
t := Text { text: root.text; }
}
TouchArea {
clicked => {
p.show();
cond = false;
}
}
}
}