Skip to content

Commit

Permalink
ttg_parsec_data_wrapper_t's move assignment always cleans up after it…
Browse files Browse the repository at this point in the history
…self
  • Loading branch information
evaleev committed Jul 24, 2024
1 parent c8c2b95 commit 2dd5905
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions ttg/ttg/parsec/ttg_data_copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,12 @@ namespace ttg_parsec {
inline
ttg_parsec_data_wrapper_t& ttg_parsec_data_wrapper_t::operator=(ttg_parsec_data_wrapper_t&& other) {
m_data = std::move(other.m_data);
/* check whether the owning ttg_data_copy has already moved us */
if (other.m_ttg_copy != m_ttg_copy) {
/* remove from old ttg copy */
other.remove_from_owner();
/* remove from old ttg copy */
other.remove_from_owner();

if (nullptr != m_ttg_copy) {
/* register with the new ttg_copy */
m_ttg_copy->add_device_data(this);
}
if (nullptr != m_ttg_copy) {
/* register with the new ttg_copy */
m_ttg_copy->add_device_data(this);
}
return *this;
}
Expand Down

0 comments on commit 2dd5905

Please sign in to comment.