Skip to content

Define ownership of QSharedMemory* pointer #184

@michaelhubatka

Description

@michaelhubatka

The QSharedMemory object is currently dynamically allocated using the new operator

d->memory = new QSharedMemory( d->blockServerName );

and finally deleted in the abortSafely() function.

I suggest to define an ownership for the pointer. Either by defining a QObject parent in the constructor or by using a std::uniqe_ptr.

This will increase the probability that the destructor of the QSharedMemory object is called for unintended program flows.

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