In my case it turned out that the problem was in the latter usage of this dictionary when I tried to get subdictionary from it. To be exact in this code:
var location: CLLocation? = nil
if let geometryDictionary = json["geometry"], locationDictionary = geometryDictionary["location"], latitude = locationDictionary["lat"] as? CLLocationDegrees, longitude = locationDictionary["lng"] as? CLLocationDegrees {
location = CLLocation(latitude: latitude, longitude: longitude)
}
The problem was that I received geometryDictionary and locationDictionary references without specifying their type, so compiler assumed they are AnyObject. I still was able to get their value like from dictionary so the code worked. When I added the type to them, the leaks stopped.
var location: CLLocation? = nil
if let geometryDictionary = json["geometry"] as? [String : AnyObject], locationDictionary = geometryDictionary["location"] as? [String : AnyObject], latitude = locationDictionary["lat"] as? CLLocationDegrees, longitude = locationDictionary["lng"] as? CLLocationDegrees {
location = CLLocation(latitude: latitude, longitude: longitude)
}