Opened 14 years ago

Closed 14 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@… 14 years ago.
The proposed fix

Download all attachments as: .zip

Change History (9)

comment:1 by Marshall Clow, 14 years ago

Component: Nonesmart_ptr
Owner: set to Peter Dimov

comment:2 by Peter Dimov, 14 years ago

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

comment:3 by Andrey.Semashev@…, 14 years ago

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

by Andrey.Semashev@…, 14 years ago

Attachment: make_shared.hpp.diff added

The proposed fix

comment:4 by anonymous, 14 years ago

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

comment:5 by anonymous, 14 years ago

Milestone: Boost 1.37.0To Be Determined

comment:6 by Peter Dimov, 14 years ago

Milestone: To Be DeterminedBoost 1.39.0

comment:7 by Peter Dimov, 14 years ago

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

comment:8 by Peter Dimov, 14 years ago

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.