mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Fix PostEvent() segfault (#403)
Fix segfault when PostEvent() called on inactive screen. Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
@@ -47,6 +47,20 @@ TEST(ScreenInteractive, Signal_SIGFPE) {
|
||||
TestSignal(SIGFPE);
|
||||
}
|
||||
|
||||
// Regression test for:
|
||||
// https://github.com/ArthurSonzogni/FTXUI/issues/402
|
||||
TEST(ScreenInteractive, PostEventToNonActive) {
|
||||
auto screen = ScreenInteractive::FitComponent();
|
||||
screen.Post(Event::Custom);
|
||||
}
|
||||
|
||||
// Regression test for:
|
||||
// https://github.com/ArthurSonzogni/FTXUI/issues/402
|
||||
TEST(ScreenInteractive, PostTaskToNonActive) {
|
||||
auto screen = ScreenInteractive::FitComponent();
|
||||
screen.Post([] {});
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
||||
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
||||
|
Reference in New Issue
Block a user