Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
59bf9471
Unverified
Commit
59bf9471
authored
Sep 03, 2018
by
Dominik Charousset
Committed by
GitHub
Sep 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #751
Fix segfault on changing to empty behavior
parents
ab8ab5fa
b07be4a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
libcaf_core/src/scheduled_actor.cpp
libcaf_core/src/scheduled_actor.cpp
+2
-1
libcaf_core/test/behavior.cpp
libcaf_core/test/behavior.cpp
+15
-0
No files found.
libcaf_core/src/scheduled_actor.cpp
View file @
59bf9471
...
...
@@ -768,7 +768,8 @@ void scheduled_actor::do_become(behavior bhvr, bool discard_old) {
if
(
discard_old
&&
!
bhvr_stack_
.
empty
())
bhvr_stack_
.
pop_back
();
// request_timeout simply resets the timeout when it's invalid
bhvr_stack_
.
push_back
(
std
::
move
(
bhvr
));
if
(
bhvr
)
bhvr_stack_
.
push_back
(
std
::
move
(
bhvr
));
set_receive_timeout
();
}
...
...
libcaf_core/test/behavior.cpp
View file @
59bf9471
...
...
@@ -24,8 +24,12 @@
#include <functional>
#include "caf/send.hpp"
#include "caf/behavior.hpp"
#include "caf/actor_system.hpp"
#include "caf/message_handler.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/make_type_erased_tuple_view.hpp"
using
namespace
caf
;
...
...
@@ -94,4 +98,15 @@ CAF_TEST(multiple_lambda_construct) {
CAF_CHECK_EQUAL
(
f
(
m3
),
none
);
}
CAF_TEST
(
become_empty_behavior
)
{
actor_system_config
cfg
{};
actor_system
sys
{
cfg
};
auto
make_bhvr
=
[](
event_based_actor
*
self
)
->
behavior
{
return
{
[
=
](
int
)
{
self
->
become
(
behavior
{});
}
};
};
anon_send
(
sys
.
spawn
(
make_bhvr
),
int
{
5
});
}
CAF_TEST_FIXTURE_SCOPE_END
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment