Skip to content

DPL: Fix leaks and self-assignment in Array2D - #15938

Merged
aalkin merged 1 commit into
AliceO2Group:devfrom
aalkin:fix-array2d
Oct 13, 2026
Merged

aalkin merged 1 commit into
AliceO2Group:devfrom
aalkin:fix-array2d

Conversation

@aalkin

@aalkin aalkin commented Oct 12, 2026

Copy link
Copy Markdown
Member
  • The copy and move assignment operators overwrote the data pointer without releasing the previous buffer, leaking it on every assignment to a non-empty array
  • Copy self-assignment also allocated the new buffer before reading from the source, so the array was filled from its own uninitialized memory.

Now guards against self-assignment and releases the old buffer.

Split from #15880.

The copy and move assignment operators overwrote the data pointer
without releasing the previous buffer, leaking it on every assignment
to a non-empty array

Copy self-assignment also allocated the new buffer before reading from
the source, so the array was filled from its own uninitialised memory.

Now guards against self-assignment and releases the old buffer.
@aalkin
aalkin merged commit 4a43295 into AliceO2Group:dev Oct 13, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants