cmake: make use of QSharedPointer<CMakeServer> from the start

Authored by apol on Jan 15 2019, 2:46 AM.

Description

cmake: make use of QSharedPointer<CMakeServer> from the start

Don't start using the sharedpointer at some random point in the lifetime
of the object.
Make sure we don't parent it, as QSharedPointer will try to delete it
eventually as well.

Details

Committed
apolJan 15 2019, 2:46 AM
Parents
R32:b2936f50b653: GIT_SILENT made messages (after extraction)
Branches
Unknown
Tags
Unknown
kossebau added subscribers: kfunk, kossebau.EditedFeb 3 2019, 4:15 PM

@apol Hi, this change needs some more post-processing in the codebase it seems, as in void ChooseCMakeInterfaceJob::failedConnection(int code) there is code like this:

server->deleteLater();
server = nullptr;

The deleteLater() could be removed now, given the life-time is now managed by all the shared owners? Or was it needed for something else, which now might be no longer working?
Then the server = nullptr; only worls for Qt >= 5.8, as here by what I saw in the API the QSharedPointer(nullptr) constructor is used, which only was introduced with 5.8, thus also the failing builds on @kfunk 's CI.

No time myself to invest more or do a patch, so just pointing out what I found right now.