fix preview dialogxml crash
This commit is contained in:
@@ -1152,12 +1152,14 @@ void preview_dialog_xml() {
|
|||||||
fs::path dialog_xml = nav_get_rsrc({"xml"});
|
fs::path dialog_xml = nav_get_rsrc({"xml"});
|
||||||
std::unique_ptr<DialogDefn> defn(load_dialog_defn(dialog_xml));
|
std::unique_ptr<DialogDefn> defn(load_dialog_defn(dialog_xml));
|
||||||
cDialog dialog(*defn);
|
cDialog dialog(*defn);
|
||||||
// Make every control's click event close the dialog
|
// Make every clickable control's click event close the dialog
|
||||||
for (auto control : dialog){
|
for (auto control : dialog){
|
||||||
|
try{
|
||||||
control.second->attachClickHandler([](cDialog& me, std::string item_hit, eKeyMod mod) -> bool {
|
control.second->attachClickHandler([](cDialog& me, std::string item_hit, eKeyMod mod) -> bool {
|
||||||
me.toast(false);
|
me.toast(false);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
}catch(...){}
|
||||||
}
|
}
|
||||||
dialog.run();
|
dialog.run();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user