mapbox / mapbox/mapbox-maps-flutter

Calling easeTo may be creating a memory leak

オープン
#809 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Dart
スター
380
フォーク
204
PR マージ指標
30日以内にマージされた PR はありません

説明

I have a handful of buttons on top of my Mapbox map that perform various functions with the map. One of them is a "3D view toggle". This function just calls easeTo. Im getting some strange behaviour after interacting with this button that I dont get at all if I dont touch it. Ive attached the code were using as well as a video of what this issue looks like.

Mapbox SDK Version: Seems to be all
Testing on iOS

```
void _togglePitch() {
// Prevent multiple simultaneous pitch changes
if (_isEasingInProgress) {
return;
}

// Ensures mapboxMap is not null before attempting to use it
if (mapboxMap == null) {
debugPrint('MapboxMap is not initialized');
return;
}

try {
// Set flag to prevent additional calls
setState(() {
_isEasingInProgress = true;
is3D = !is3D;
});

mapboxMap!.easeTo(
CameraOptions(pitch: is3D ? 75 : 0),
MapAnimationOptions(duration: 1000),
).then((_) {
// Reset the flag when animation is complete
setState(() {
_isEasingInProgress = false;
});
}).catchError((error) {
debugPrint('Error toggling pitch: $error');
setState(() {
is3D = !is3D;
_isEasingInProgress = false;
});
});
} catch (e) {
debugPrint('Error toggling pitch: $e');
// Optionally, reverts the state if the pitch change fails
setState(() {
is3D = !is3D;
_isEasingInProgress = false;
});
}
}
```

https://github.com/user-attachments/assets/153d13f6-0723-4a1c-b634-0aaa5388c295

![IMG_4938](https://github.com/user-attachments/assets/6b0a9337-484e-4301-91af-8531ad5bbff3)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された _togglePitch 関数とその easeTo 呼び出しから始め、添付されたコードと動画を使って iOS で報告された動作を再現します。指定された SDK バージョン全体で、3D トグルありとなしの動作を比較します。メモリの動作が説明され、最小限の再現例または確認済みの原因が文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
dart, flutter
領域
mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。