Skip to content

Commit

Permalink
fix pezy#145
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy authored and pezy committed Mar 7, 2015
1 parent 83ea7f7 commit 7d82c4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ch12/ex12_12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ int main()
//process(p);

/** @brief
* Legal. A shared_ptr is construct first using plain pointer p.
* Afterwards,this shared_ptr is copied into the parameter of process().
* Legal. But it's a bad practice to do so.
* Because using smart pointer together with raw pointer could potentially cause problems.
* For example double free as shown in #145.
*
* Check issue #145 for detail, thx @endyul for reporting
*/
//process(std::shared_ptr<int>(p));

Expand Down

0 comments on commit 7d82c4b

Please sign in to comment.