mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Fix memory leak in LibraryCreator
This commit is contained in:
parent
b70556eb41
commit
0fcf9d0cba
@ -377,16 +377,20 @@ void LibraryCreator::update(QDir dirS)
|
|||||||
bool updated;
|
bool updated;
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i = 0, j = 0; (i < lenghtS) || (j < lenghtD);) {
|
for (i = 0, j = 0; (i < lenghtS) || (j < lenghtD);) {
|
||||||
if (stopRunning)
|
if (stopRunning) {
|
||||||
|
qDeleteAll(listD);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
updated = false;
|
updated = false;
|
||||||
if (i >= lenghtS) // finished source files/dirs
|
if (i >= lenghtS) // finished source files/dirs
|
||||||
{
|
{
|
||||||
// QLOG_WARN() << "finished source files/dirs" << dirS.absolutePath();
|
// QLOG_WARN() << "finished source files/dirs" << dirS.absolutePath();
|
||||||
// delete listD //from j
|
// delete listD //from j
|
||||||
for (; j < lenghtD; j++) {
|
for (; j < lenghtD; j++) {
|
||||||
if (stopRunning)
|
if (stopRunning) {
|
||||||
|
qDeleteAll(listD);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
DBHelper::removeFromDB(listD.at(j), (_database));
|
DBHelper::removeFromDB(listD.at(j), (_database));
|
||||||
}
|
}
|
||||||
updated = true;
|
updated = true;
|
||||||
@ -396,8 +400,10 @@ void LibraryCreator::update(QDir dirS)
|
|||||||
// QLOG_WARN() << "finished library files/dirs" << dirS.absolutePath();
|
// QLOG_WARN() << "finished library files/dirs" << dirS.absolutePath();
|
||||||
// create listS //from i
|
// create listS //from i
|
||||||
for (; i < lenghtS; i++) {
|
for (; i < lenghtS; i++) {
|
||||||
if (stopRunning)
|
if (stopRunning) {
|
||||||
|
qDeleteAll(listD);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
QFileInfo fileInfoS = listS.at(i);
|
QFileInfo fileInfoS = listS.at(i);
|
||||||
if (fileInfoS.isDir()) // create folder
|
if (fileInfoS.isDir()) // create folder
|
||||||
{
|
{
|
||||||
@ -548,4 +554,6 @@ void LibraryCreator::update(QDir dirS)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDeleteAll(listD);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user