Modify

Opened 9 years ago

Closed 9 years ago

#2126 closed Bugs (fixed)

make_shared doesn't work with enable_shared_from_this

Reported by: Theo Zourzouvillys <theo@…> Owned by: Peter Dimov
Milestone: Boost 1.39.0 Component: smart_ptr
Version: Boost 1.36.0 Severity: Problem
Keywords: Cc:

Description

make_shared<T>() doesn't seem to initialise the enable_shared_from_this<T> internal weak pointer, causing an assert upon calling shared_from_this() for any instance initialised using make_shared instead of new.

Attachments (1)

make_shared.hpp.diff (11.2 KB) - added by Andrey.Semashev@… 9 years ago.
The proposed fix

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by Marshall Clow

Component: Nonesmart_ptr
Owner: set to Peter Dimov

comment:2 Changed 9 years ago by Peter Dimov

Milestone: Boost 1.36.0Boost 1.37.0
Status: newassigned
Version: Boost Release BranchBoost 1.36.0

comment:3 Changed 9 years ago by Andrey.Semashev@…

Is this ticket still open? The trunk version seems to fix the problem in my code.

Changed 9 years ago by Andrey.Semashev@…

Attachment: make_shared.hpp.diff added

The proposed fix

comment:4 Changed 9 years ago by anonymous

Looks like 1.37 still have the bug, and the current trunk as well.

comment:5 Changed 9 years ago by anonymous

Milestone: Boost 1.37.0To Be Determined

comment:6 Changed 9 years ago by Peter Dimov

Milestone: To Be DeterminedBoost 1.39.0

comment:7 Changed 9 years ago by Peter Dimov

(In [51581]) Fix enable_shared_from_this-related tickets in trunk. Refs #2126. Refs #2584.

comment:8 Changed 9 years ago by Peter Dimov

Resolution: fixed
Status: assignedclosed

(In [51632]) Merge [51581] to release. Fixes #2126. Fixes #2584.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Dimov.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.