Skip to content

Commit

Permalink
Replace shared_ptr with move ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
lebdron authored and kirkshoop committed May 11, 2018
1 parent abaf988 commit c7de35b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Rx/v2/src/rxcpp/rx-scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,19 @@ class schedulable : public schedulable_base
public:
~exit_recursed_scope_type()
{
if (that != nullptr) {
that->requestor = nullptr;
}
}
exit_recursed_scope_type(const recursed_scope_type* that)
: that(that)
{
}
exit_recursed_scope_type(exit_recursed_scope_type && other) /*noexcept*/
: that(other.that)
{
other.that = nullptr;
}
};
public:
recursed_scope_type()
Expand All @@ -480,9 +487,9 @@ class schedulable : public schedulable_base
// no change in recursion scope
return *this;
}
std::shared_ptr<exit_recursed_scope_type> reset(const recurse& r) const {
exit_recursed_scope_type reset(const recurse& r) const {
requestor = std::addressof(r.get_recursed());
return std::make_shared<exit_recursed_scope_type>(this);
return exit_recursed_scope_type(this);
}
bool is_recursed() const {
return !!requestor;
Expand Down

0 comments on commit c7de35b

Please sign in to comment.