181 WRITELOG( "RHarvesterClient::Close()" ); |
181 WRITELOG( "RHarvesterClient::Close()" ); |
182 OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_CLOSE, "RHarvesterClient::Close" ); |
182 OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_CLOSE, "RHarvesterClient::Close" ); |
183 |
183 |
184 delete iSessionWatcher; |
184 delete iSessionWatcher; |
185 iSessionWatcher = NULL; |
185 iSessionWatcher = NULL; |
186 |
186 |
|
187 WRITELOG( "RHarvesterClient::Close() - cancelling pending harvesting requests" ); |
187 if( iRequestQueue && iRequestQueue->RequestsPending() ) |
188 if( iRequestQueue && iRequestQueue->RequestsPending() ) |
188 { |
189 { |
189 iRequestQueue->Cancel(); |
190 iRequestQueue->Cancel(); |
190 } |
191 } |
191 |
192 |
192 // cancels Harvest Complete request if it exist at server |
193 WRITELOG( "RHarvesterClient::Close() - removing harvester client observer" ); |
193 if( iObserver ) |
194 if( iObserver ) |
194 { |
195 { |
195 RemoveObserver( iObserver ); |
196 RemoveObserver( iObserver ); |
196 } |
197 } |
|
198 UnregisterHarvestComplete(); |
197 |
199 |
198 WRITELOG( "RHarvesterClient::Close() - UnregisterHarvest done" ); |
200 WRITELOG( "RHarvesterClient::Close() - UnregisterHarvest done" ); |
199 |
201 |
|
202 WRITELOG( "RHarvesterClient::Close() - forcing remaining harvesting requests" ); |
200 if( iRequestQueue && iRequestQueue->RequestsPending() ) |
203 if( iRequestQueue && iRequestQueue->RequestsPending() ) |
201 { |
204 { |
202 WRITELOG( "RHarvesterClient::Close() - Pending harvesting requests detected -> ForceHarvest" ); |
205 WRITELOG( "RHarvesterClient::Close() - Pending harvesting requests detected -> ForceHarvest" ); |
203 iRequestQueue->ForceRequests(); |
206 iRequestQueue->ForceRequests(); |
204 } |
207 } |