Skip to content

A mistake in ViBe destructor #2

Description

@Lustar95

In ViBe::init(), a 3d array is applied, but it's released in a wrong way.
void ViBe::deleteSamples() { delete samples; }
It doesn't matter if ViBe.init() is just used once. But in the case where background should be built for many times, the program will crash due to a lack of memory.

The right way is to release the pointers one by one with the opposite order of applying for arrays.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions