Fix memory leak in QNdefNfcSmartPosterRecord
The pointers in QNdefNfcSmartPosterRecordPrivate were only deleted
in the QNdefNfcSmartPosterRecord::cleanup() method, but it was not
called at destruction. Rewrite the code to make sure that the
destructor of Private always cleans up the memory.
A more modern approach would be to use std::optional, but I leave it
for a follow-up patch, because I want this change to be picked down
to 5.15.
Fixes: QTBUG-136576
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I5ca3ae24d638e4b28bc4f5f92604ec0c1564b489
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>