Fixed task object leaks
This commit is contained in:
parent
dfe56dcfc1
commit
cc6729f440
1 changed files with 8 additions and 1 deletions
|
@ -427,6 +427,7 @@ void BooksShelf::CopyTask::performTask()
|
||||||
|
|
||||||
class BooksShelf::DeleteTask : public BooksTask
|
class BooksShelf::DeleteTask : public BooksTask
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DeleteTask(BooksBook* aBook);
|
DeleteTask(BooksBook* aBook);
|
||||||
~DeleteTask();
|
~DeleteTask();
|
||||||
|
@ -556,6 +557,7 @@ void BooksShelf::onLoadTaskDone()
|
||||||
{
|
{
|
||||||
HASSERT(iLoadTask);
|
HASSERT(iLoadTask);
|
||||||
HASSERT(iLoadTask == sender());
|
HASSERT(iLoadTask == sender());
|
||||||
|
iLoadTask->release(this);
|
||||||
iLoadTask = NULL;
|
iLoadTask = NULL;
|
||||||
Q_EMIT loadingChanged();
|
Q_EMIT loadingChanged();
|
||||||
}
|
}
|
||||||
|
@ -1025,7 +1027,12 @@ void BooksShelf::onCopyTaskDone()
|
||||||
|
|
||||||
void BooksShelf::onDeleteTaskDone()
|
void BooksShelf::onDeleteTaskDone()
|
||||||
{
|
{
|
||||||
HVERIFY(iDeleteTasks.removeOne((DeleteTask*)sender()));
|
DeleteTask* task = qobject_cast<DeleteTask*>(sender());
|
||||||
|
HASSERT(task);
|
||||||
|
if (task) {
|
||||||
|
task->release(this);
|
||||||
|
HVERIFY(iDeleteTasks.removeOne(task));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<int,QByteArray> BooksShelf::roleNames() const
|
QHash<int,QByteArray> BooksShelf::roleNames() const
|
||||||
|
|
Loading…
Reference in a new issue