Project

General

Profile

Bug #6049

WTimer::singleShot send signal to dead object

Added by Drus Kor about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
10/25/2017
Due date:
% Done:

0%

Estimated time:

Description

@ WContainerWidget* container = app~~root()>addWidget( std::make_unique() );

WTimer::singleShot( std::chrono::milliseconds( 1000 ), container, &WContainerWidget::hide );

app
root()~~>clear();@

#1

Updated by Wim Dumon about 5 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.

#2

Updated by Drus Kor about 5 years ago

Already has look at sources.

Need update in function description.

I was write own function with parent delete.

thx!

#3

Updated by Roel Standaert about 5 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.

#4

Updated by Roel Standaert about 5 years ago

  • Status changed from InProgress to Resolved

I just pushed some changes to GitHub that should fix this.

#5

Updated by Roel Standaert about 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF