I start a BackgroundTaskWithExpirationHandler when the application waken up by significant change location update. is it important to close the task as below:
if (bgTask != UIBackgroundTaskInvalid)
{
[[UIApplication sharedApplication] endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
}
what would happen if I didn’t close the task.
Yes, it is important. Otherwise battery will be drained out soon.
Check the memory usage details of background apps here – http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html