Re: Re: Signal with return value will crash
Hi,
I tried the signals, the code below will crash
#include
int _tmain(int argc, _TCHAR* argv[]) { boost::signal _sig; _sig(10); return 0; }
but code below works well
#include
int _tmain(int argc, _TCHAR* argv[]) { boost::signal _sig; _sig(10); return 0; }
The only difference is one has return value, the other doesn't, is this a bug or by design?
Sounds like a bug... could you give us more information? Compiler, platform, Boost version, etc.
Doug
I'm using win2000 pro build 5.00.2195 service pack4, Visual Studio 2003 version 7.1.3091, boost v1_31_0. And I also tested this using boost v1_32_0, also has this bug. Before crash, this assert will fail: "Assertion failed: first != last, file d:\boost_1_31_0\boost\last_value.hpp, line 23" Thanks, Wang Yun
Sounds like a bug... could you give us more information? Compiler, platform, Boost version, etc.
I'm using win2000 pro build 5.00.2195 service pack4, Visual Studio 2003 version 7.1.3091, boost v1_31_0. And I also tested this using boost v1_32_0, also has this bug.
Before crash, this assert will fail: "Assertion failed: first != last, file d:\boost_1_31_0\boost\last_value.hpp, line 23"
WinXP, Visual Studio 6.0, boost-1_31. Assertion fails only in cases when there are no slots connected to the signal. Sorry for poor English. Zoreslav.
On Nov 16, 2004, at 10:48 PM, a_hao@21cn.com wrote:
I'm using win2000 pro build 5.00.2195 service pack4, Visual Studio 2003 version 7.1.3091, boost v1_31_0. And I also tested this using boost v1_32_0, also has this bug.
Before crash, this assert will fail: "Assertion failed: first != last, file d:\boost_1_31_0\boost\last_value.hpp, line 23"
Oh, right! That is by-design, then: when you declare a non-void signal with the default combiner, it has to get a value from somewhere to return. When first == last, there is no such value so it asserts. If you don't want this behavior, you can write your own combiner that gets a result from somewhere else. Doug
participants (3)
-
a_hao@21cn.com
-
Doug Gregor
-
Zoreslav Khimich