BaseApi: do not use smart pointers for network managers
Both QNetworkAccessManager and QRestAccessManager are QObject-based
classes, which means that storing them in smart pointers can lead
to double free problems due to using both ref-counting and QObject
parent-child relation to manage the lifetime.
This commit chooses the traditional way of storing QObject-based
members as raw pointers.
When using the setter, it's the user's responsibility to make sure
that the provided pointers outlive the object.
The tricky part in the setter is that we need to delete the old
objects only if they were created by us. So, check the parent()
before deleting the old objects.
Found in API review.
Task-number: QTBUG-142312
Pick-to: 6.11
Change-Id: Icac5e1a207124e3737e792a15e4c7fd592570521
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>