Skip to content
Snippets Groups Projects
Commit 801f87b1 authored by Enric Tejedor Saavedra's avatar Enric Tejedor Saavedra
Browse files

[Exp PyROOT] Object at index might exist: use ConstructedAt, not New

parent 364ac48d
No related branches found
No related tags found
No related merge requests found
......@@ -27,8 +27,8 @@ using namespace CPyCppyy;
// Clone an object into a position of a TClonesArray
static TObject *CloneObjectInPlace(const TObject *obj, TClonesArray *cla, int index)
{
// Create object with default constructor at index
char *arrObj = (char *)cla->New(index);
// Get or create object with default constructor at index
char *arrObj = (char *)cla->ConstructedAt(index);
if (!arrObj) {
PyErr_Format(PyExc_RuntimeError, "Failed to create new object at index %d of TClonesArray", index);
return nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment