Bug #2193
closedWTimer::singleShot broken with boost::signals2
Description
Hello!
Just trying Wt 3.3.1 both on my desktop (with boost 1.54) and my test server (boost 1.53), and I noticed that WTimer::singleShot seems to be broken when using boost 1.54 new signals2.
Attached there's a sample application to demonstrate the issue: when running it on my desktop, I can see only the non singleshot timer updates, while on my test server I can see all of them.
Thanks
Marco
Files
Updated by Marco Gulino about 11 years ago
I Just noticed I wasn't logged in, that's my report anyway.
Thanks
Updated by Koen Deforche about 11 years ago
- Status changed from New to InProgress
- Assignee set to Wim Dumon
- Target version set to 3.3.1
Updated by Wim Dumon about 11 years ago
This may be a bug in signals2.
The problem is: a static single shot WTimer internally connects a listener to the timeout signal, which eventually calls 'delete this'. Through the implementation of WTimer, this slot is executed before the other slots, so the signal is deleted while it's calling its members.
In boost.signals, this worked. Signals2 documents that this should work. So I filed a bug report.
https://svn.boost.org/trac/boost/ticket/9103
I think the following is a valid workaround: in WTimer, at the end of the file, switch timer~~start() and timer~~>timeout.connect(f), which causes the handler to be called before the WTimer is deleted.
BR,
Wim.
Updated by Wim Dumon about 11 years ago
- Status changed from InProgress to Resolved
Fix expected in boost 1.56.
Work-around for this case will be in next Wt release.
BR,
Wim.
Updated by Koen Deforche about 11 years ago
- Status changed from Resolved to Closed