Proper way to delete QOpcUaClient object
Solved
General and Desktop
-
The documentation says:
The user is responsible for deleting the returned QOpcUaClient object when it is no longer needed.
I'm not sure if I'm doing it the right way:
QOpcUaClient *_opcUaClient; // ... // when I need to delete the client (i.e. after a disconnection) if (_opcUaClient) { _opcUaClient->disconnect(); delete _opcUaClient; _opcUaClient = nullptr; }
Is it correct?
-
Hi,
Signal/Slot disconnection should happen automatically upon deletion so there's no need to do that. Other than that, it looks good.
-