FindPanel: Reorder operations to avoid leak

CID 1234656
This commit is contained in:
Philippe Saint-Pierre
2015-07-03 11:32:44 -04:00
parent b3f2ebf008
commit 217e35d624
+9 -9
View File
@@ -3177,20 +3177,20 @@ private:
void
DeleteTransientQueriesTask::StartUpTransientQueryCleaner()
{
TTracker* tracker = dynamic_cast<TTracker*>(be_app);
ASSERT(tracker != NULL);
if (tracker == NULL)
return;
// set up a task that wakes up when the machine is idle and starts
// killing off old transient queries
DeleteTransientQueriesFunctor* worker
= new DeleteTransientQueriesFunctor(new DeleteTransientQueriesTask());
TTracker* tracker = dynamic_cast<TTracker*>(be_app);
ASSERT(tracker != NULL);
if (tracker != NULL) {
tracker->MainTaskLoop()->RunWhenIdle(worker,
30 * 60 * 1000000, // half an hour initial delay
5 * 60 * 1000000, // idle for five minutes
10 * 1000000);
}
tracker->MainTaskLoop()->RunWhenIdle(worker,
30 * 60 * 1000000, // half an hour initial delay
5 * 60 * 1000000, // idle for five minutes
10 * 1000000);
}