Bug #6049
closedWTimer::singleShot send signal to dead object
0%
Description
@ WContainerWidget* container = app~~root()>addWidget( std::make_unique() );root()~~>clear();@
WTimer::singleShot( std::chrono::milliseconds( 1000 ), container, &WContainerWidget::hide );
app
Updated by Wim Dumon about 7 years ago
- Status changed from New to Feedback
Hey Drus,
It's not ok to do this. If in doubt about whether your target is still alive, you can use a observing_ptr<>, which can check if the target was deleted.
Best regards,
Wim.
Updated by Drus Kor about 7 years ago
Already has look at sources.
Need update in function description.
I was write own function with parent delete.
thx!
Updated by Roel Standaert about 7 years ago
- Status changed from Feedback to InProgress
While your code does not work, it ideally should work. It's actually a regression from Wt 3, since this should really be equivalent to creating a timer and then connecting its timeout()
signal, which does work properly in Wt 4. I'll make it so it does what you'd expect.
Updated by Roel Standaert about 7 years ago
- Status changed from InProgress to Resolved
I just pushed some changes to GitHub that should fix this.
Updated by Roel Standaert about 7 years ago
- Status changed from Resolved to Closed