Skip to content

EXC_BAD_ACCESS FlagSynchronizer:63 #314

@m1entus

Description

@m1entus

Describe the bug
Crash (synchronization issue)

SDK version
9.1.1

OS/platform
iOS

Additional context
Zrzut ekranu 2023-10-17 o 10 57 18

Seems this is retain cycle issue:

self.throttler.runThrottled {
      // since going online was throttled, check the last called setOnline value and whether we can go online
      self.go(online: goOnline && self.canGoOnline, reasonOnlineUnavailable: self.reasonOnlineUnavailable(goOnline: goOnline), completion: completion)
}

here you are capturing self inside throttler:
LDClient -> throttler -> runQueue -> runThrottled -> self (LDClient)

this method should look like this:

self.throttler.runThrottled { [weak self] in
      guard let self else {
          completion?()
          return
      }
      // since going online was throttled, check the last called setOnline value and whether we can go online
      self.go(online: goOnline && self.canGoOnline, reasonOnlineUnavailable: self.reasonOnlineUnavailable(goOnline: goOnline), completion: completion)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions