Project

General

Profile

Actions

Bug #6049

closed

WTimer::singleShot send signal to dead object

Added by Drus Kor over 6 years ago. Updated over 6 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();@

Actions #1

Updated by Wim Dumon over 6 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.

Actions #2

Updated by Drus Kor over 6 years ago

Already has look at sources.

Need update in function description.

I was write own function with parent delete.

thx!

Actions #3

Updated by Roel Standaert over 6 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.

Actions #4

Updated by Roel Standaert over 6 years ago

  • Status changed from InProgress to Resolved

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

Actions #5

Updated by Roel Standaert over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF