Exception thrown when map is dealloc'd

141
2
Jump to solution
02-18-2020 02:59 PM
New Contributor III

Hello,

We're getting a lot of these exceptions when moving from a view that has an Esri map, to a view that doesn't have one.

Thread 1 Queue : com.apple.main-thread (serial)
#0 0x000000011a661854 in __cxa_throw ()
#1 0x000000010ed7dc60 in std::exception_ptr std::make_exception_ptr<pplx::task_canceled>(pplx::task_canceled) ()
#2 0x000000010ed7dfa7 in pplx::details::_CancellationTokenCallback<Esri_runtimecore::Geo_views::Map_view::set_viewpoint_async_(Esri_runtimecore::Geo_model::Viewpoint const&, float, double, Esri_runtimecore::Geo_views::Geo_view::Animate_set_viewpoint, Esri_runtimecore::Map_renderer::Animation::Curve)::$_25>::_Exec() ()
#3 0x000000010ec6a78f in pplx::details::_CancellationTokenState::_Cancel() ()
#4 0x000000010ec722b9 in Esri_runtimecore::Geo_views::Geo_view::~Geo_view() ()
#5 0x000000010e928745 in RT_GeoView_destroy ()
#6 0x000000010e533840 in -[RTCGeoView dealloc] ()
#7 0x000000010e6109a9 in -[RTCMapView dealloc] ()
#8 0x0000000117cbb0d6 in objc_object::sidetable_release(bool) ()
#9 0x000000010e4f08c5 in -[AGSGeoView .cxx_destruct] ()
#10 0x0000000117ca4f02 in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#11 0x0000000117cb44b3 in objc_destructInstance ()
#12 0x0000000118ac95be in -[NSObject(NSObject) __dealloc_zombie] ()
#13 0x000000011e25a6c2 in -[UIResponder dealloc] ()
#14 0x000000011e6e231c in -[UIView dealloc] ()
#15 0x000000010e4ec81b in -[AGSGeoView dealloc] ()
#16 0x000000010e67b03d in -[AGSMapViewCommon dealloc] ()
#17 0x000000010e469285 in -[AGSMapView dealloc] ()
#18 0x0000000116da08a6 in @objc TCEsriSimpleMapView.__ivar_destroyer ()
#19 0x0000000117ca4f02 in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#20 0x0000000117cb44b3 in objc_destructInstance ()
#21 0x0000000118ac95be in -[NSObject(NSObject) __dealloc_zombie] ()
#22 0x000000011e25a6c2 in -[UIResponder dealloc] ()
#23 0x000000011e6e231c in -[UIView dealloc] ()
#24 0x0000000116da067b in TCEsriSimpleMapView.__deallocating_deinit at /path/TCEsriSimpleMapView.swift:154
#25 0x0000000116da06bb in @objc TCEsriSimpleMapView.__deallocating_deinit ()
#26 0x0000000116dbc2f9 in ___lldb_unnamed_symbol262$$TCFramework ()
#27 0x0000000119909f10 in _swift_release_dealloc ()
#28 0x0000000116dbc38d in block_destroy_helper.152 ()
#29 0x000000011a3639c2 in _Block_release ()
#30 0x000000011a24e96c in _dispatch_source_handler_dispose ()
#31 0x000000011a24da82 in _dispatch_source_invoke ()
#32 0x000000011a245c1d in _dispatch_main_queue_callback_4CF ()
#33 0x0000000118a0b049 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#34 0x0000000118a05ca9 in __CFRunLoopRun ()
#35 0x0000000118a05066 in CFRunLoopRunSpecific ()
#36 0x0000000122436bb0 in GSEventRunModal ()
#37 0x000000011e22dd4d in UIApplicationMain ()
#38 0x000000010d8e4b1b in main at /path/AppDelegate.swift:14
#39 0x000000011a2bfc25 in start ()

We're getting these because we've set a breakpoint on "All Exceptions". AFAIK, this does not actually crash the app.

Still, I'd like to know if there is something we can do to not get them anymore (e.g. cancel any operations, clear any other delegates, etc).

Thank you,

Marius

Reply
0 Kudos
1 Solution

Accepted Solutions
Esri Contributor

As far as I can tell these exceptions are harmless. They are caught by the c++ code wrapping pplx. All signs point to them being expected exceptions, most likely related to async data fetching tasks that were cancelled when the mapview was deallocated. You can turn off the C++ exception breakpoint and not see them (Just create an objective-c only exception breakpoint). That would only be important for you if you have C++ code in your app.

View solution in original post

2 Replies
Esri Contributor

As far as I can tell these exceptions are harmless. They are caught by the c++ code wrapping pplx. All signs point to them being expected exceptions, most likely related to async data fetching tasks that were cancelled when the mapview was deallocated. You can turn off the C++ exception breakpoint and not see them (Just create an objective-c only exception breakpoint). That would only be important for you if you have C++ code in your app.

View solution in original post

New Contributor III

I thought that that might be the case. Thanks for confirming it.

Reply
0 Kudos