Commit c216a1be authored by Piotr Padlewski's avatar Piotr Padlewski Committed by TensorFlower Gardener
Browse files

Fix emplace_back(new) calls

Doing v.emplace_back(new Type) on a std::vector<std::unique_ptr<Type>>
is not exception safe.
This is because it cause a leak of passed pointer if emplace_back would throw exception before emplacement (e.g. not enough memory to add a new element).

PiperOrigin-RevId: 208095516
parent 689fecc0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment