Skip to content

A mistake in ViBe destructor #2

@Lustar95

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.

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