can I assign another object after using deleteLater(); funcation?
Solved
General and Desktop
-
is it fine? if i will assign new object to
currentDataFile
pointer. once I calldeleteLater()
for old object with help ofcurrentDataFile
.private member of class
QFile* currentDataFile; QString currentDataFilePath;
method of class
void DataHandle::createNewDataFile(uint16_t nodeNum, const ExperimentSummaryInfo_t &expInfo) { if (!currentDataFile) { createNewFilePath(nodeNum, expInfo); currentDataFile->flush(); currentDataFile->close(); currentDataFile->deleteLater(); } currentDataFile = new QFile(currentDataFilePath); if (!currentDataFile->open(QIODevice::WriteOnly)) { currentDataFile->close(); currentDataFile->deleteLater(); } return; }