Skip to content

Commit

Permalink
Update end_apply_string_data_t.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed Oct 26, 2023
1 parent f1efb13 commit 5e2fc33
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct end_apply_string_data_t final:base_string_data_t<char_T>,instance_struct<
_used_size=p->_used_size;
_to_size=p->_to_size;
_m=move(p->_m);
_to=p->_to;//不要使用移动语义:智能指针的移动语义基于swap,会导致p->_to自我指向,进而导致内存泄漏
_to=p->_to;//不要使用移动语义:智能指针的移动语义基于swap,会导致p->_to指向p,进而导致内存泄漏
}
}
void self_changed()noexcept{
Expand Down

0 comments on commit 5e2fc33

Please sign in to comment.