Skip to content

Commit

Permalink
fix: handle concurrent list access exception
Browse files Browse the repository at this point in the history
  • Loading branch information
alexVinarskis committed Dec 30, 2023
1 parent 9bb8c72 commit d01a027
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/classes/api_cctk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ class ApiCCTK {
}

static void _callDepsChanged(bool apiReady) {
for (var callback in _callbacksDepsChanged) {
var dubList = List.from(_callbacksDepsChanged);
for (var callback in dubList) {
callback(apiReady);
}
}
static void _callStateChanged(CCTKState cctkState) {
for (var callback in _callbacksStateChanged) {
var dubList = List.from(_callbacksStateChanged);
for (var callback in dubList) {
callback(cctkState);
}
}
Expand Down Expand Up @@ -88,7 +90,8 @@ class ApiCCTK {
_cctkLock();
// create cctk query arg
String arg = '';
for (var param in _queryParameters) {
var dubList = List.from(_queryParameters);
for (var param in dubList) {
// verify that parameter is supported *before* querying it
if (cctkState.parameters[param]?.supported == null) {
/* attempt to read cached data first */
Expand Down

0 comments on commit d01a027

Please sign in to comment.