Hello, I have this problem when I close an app immediately after the ServiceFeatureTable is loaded, arcgis maps runtime crashes and it seems that the problem is dangling pointer to a task that's causing the crash.
Here's the code that I placed using the LocalServerServices sample as base code.
private async void StartServiceButtonClicked(object sender, RoutedEventArgs e)
{
try
{
// Start the selected service
await _selectedService.StartAsync();
if(_selectedService is LocalFeatureService lfs)
{
var uri = _selectedService.Url;
var serviceFeatureTable = new ServiceFeatureTable(new Uri(_selectedService.Url.ToString() + "/0"));
await serviceFeatureTable.LoadAsync();
if(serviceFeatureTable.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{
Trace.WriteLine("Sft Status Loaded");
}
}
// Update the UI
UpdateServiceControlUi();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Failed to start service");
}
}
To replicate, simply run the app, start local server, start the feature service. Wait for it to print "Feature service started", close the app. The crash doesn't happen if I wait long enough (say, around 15 seconds after).
Can anyone point me to the right direction as to how to handle serviceFeatureTables on local server without crashing it?
Here's a screenshot of the crash.
