Fix cursor leak.
A request for the list of calls requires two queries and hence two cursor to be created, one for new calls and one for old calls, and then merged. When a new request is dispatched, the old cursor are closed. However, it is possible that one of the queries completed after the new request has started. This means that we might merge two cursors that do not correspond to the same request. Moreover, this may lead to a resource leak if the same query completes and we override the cursor without closing it first. To make sure we only join two cursors from the same request, add a request id and make sure we only process requests with the correct id. Since we close and null the partial cursors when issueing a new request, and we ignore results from previous requests, we are guaranteed we always merge two cursors from the same request. Bug: 6153390 Change-Id: Ib21cd7ec938583d6d9615e43d5394173870599ed
Loading
Please register or sign in to comment