Skip to content

android-maps-ktx: Listeners aren't removed in awaitClose block in cameraEvents(): Flow implementation #80

@ychescale9

Description

@ychescale9

👋 I was looking at the new cameraEvents(): Flow<CameraEvent> implementation. It looks like the listeners aren't cleared when the channel is closed / cancelled. I'd expect something like this:

callbackFlow {
  val idleListener = GoogleMap.OnCameraIdleListener {
    offer(CameraIdleEvent)
  }
  ...
  setOnCameraIdleListener(idleListener)
  awaitClose {
    setOnCameraIdleListener(null)
    ...
  }
}

Happy to send a PR 😃 .

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.releasedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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