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
02b525bb
Commit
02b525bb
authored
Nov 25, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix accessing incompletely constructed derived ptr
parent
628fdab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
libcaf_core/caf/mixin/subscriber.hpp
libcaf_core/caf/mixin/subscriber.hpp
+3
-7
No files found.
libcaf_core/caf/mixin/subscriber.hpp
View file @
02b525bb
...
@@ -54,7 +54,7 @@ public:
...
@@ -54,7 +54,7 @@ public:
// -- overridden functions of monitorable_actor ------------------------------
// -- overridden functions of monitorable_actor ------------------------------
bool
cleanup
(
error
&&
fail_state
,
execution_unit
*
ptr
)
override
{
bool
cleanup
(
error
&&
fail_state
,
execution_unit
*
ptr
)
override
{
auto
me
=
dptr
()
->
ctrl
();
auto
me
=
this
->
ctrl
();
for
(
auto
&
subscription
:
subscriptions_
)
for
(
auto
&
subscription
:
subscriptions_
)
subscription
->
unsubscribe
(
me
);
subscription
->
unsubscribe
(
me
);
subscriptions_
.
clear
();
subscriptions_
.
clear
();
...
@@ -69,7 +69,7 @@ public:
...
@@ -69,7 +69,7 @@ public:
CAF_LOG_TRACE
(
CAF_ARG
(
what
));
CAF_LOG_TRACE
(
CAF_ARG
(
what
));
if
(
what
==
invalid_group
)
if
(
what
==
invalid_group
)
return
;
return
;
if
(
what
->
subscribe
(
dptr
()
->
ctrl
()))
if
(
what
->
subscribe
(
this
->
ctrl
()))
subscriptions_
.
emplace
(
what
);
subscriptions_
.
emplace
(
what
);
}
}
...
@@ -77,7 +77,7 @@ public:
...
@@ -77,7 +77,7 @@ public:
void
leave
(
const
group
&
what
)
{
void
leave
(
const
group
&
what
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
what
));
CAF_LOG_TRACE
(
CAF_ARG
(
what
));
if
(
subscriptions_
.
erase
(
what
)
>
0
)
if
(
subscriptions_
.
erase
(
what
)
>
0
)
what
->
unsubscribe
(
dptr
()
->
ctrl
());
what
->
unsubscribe
(
this
->
ctrl
());
}
}
/// Returns all subscribed groups.
/// Returns all subscribed groups.
...
@@ -86,10 +86,6 @@ public:
...
@@ -86,10 +86,6 @@ public:
}
}
private:
private:
Subtype
*
dptr
()
{
return
static_cast
<
Subtype
*>
(
this
);
}
// -- data members -----------------------------------------------------------
// -- data members -----------------------------------------------------------
/// Stores all subscribed groups.
/// Stores all subscribed groups.
...
...
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