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
+5 -5
View File
@@ -3177,21 +3177,21 @@ private:
void void
DeleteTransientQueriesTask::StartUpTransientQueryCleaner() 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 // set up a task that wakes up when the machine is idle and starts
// killing off old transient queries // killing off old transient queries
DeleteTransientQueriesFunctor* worker DeleteTransientQueriesFunctor* worker
= new DeleteTransientQueriesFunctor(new DeleteTransientQueriesTask()); = new DeleteTransientQueriesFunctor(new DeleteTransientQueriesTask());
TTracker* tracker = dynamic_cast<TTracker*>(be_app);
ASSERT(tracker != NULL);
if (tracker != NULL) {
tracker->MainTaskLoop()->RunWhenIdle(worker, tracker->MainTaskLoop()->RunWhenIdle(worker,
30 * 60 * 1000000, // half an hour initial delay 30 * 60 * 1000000, // half an hour initial delay
5 * 60 * 1000000, // idle for five minutes 5 * 60 * 1000000, // idle for five minutes
10 * 1000000); 10 * 1000000);
} }
}
// #pragma mark - // #pragma mark -