mapbox / mapbox/mapbox-maps-flutter
Exception thrown after calling `dispose()` on MapboxMap
まだ誰も着手していません。
- 主要言語
- Dart
- スター
- 380
- フォーク
- 204
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## Environment
- Flutter version: `3.16.9`
- mapbox_maps_flutter version: `0.5.1`
- Device: `iPhone Simulator`
- OS: `iOS 17.2`
## Steps to Reproduce
- Navigate to a screen with MapWidget
- Pop the screen with MapWidget
Code: [GitHub Gist](https://gist.github.com/kalucky0/59f2649c482abd94abc5a2a1c78e6d2f)
## Description
I'm encountering an issue where an exception is thrown after exiting a screen and calling `dispose()` on `MapboxMap`. The exception message suggests that the `MapboxMap` object is being used after being disposed.
## Expected Behavior
After calling `dispose()` on a `MapboxMap` object, the object is disposed of properly and no exception is thrown.
## Actual Behavior
The following exception is thrown:
```yaml
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: A MapboxMap was used after being disposed.
Once you have called dispose() on a MapboxMap, it can no longer be used.
#0 ChangeNotifier.debugAssertNotDisposed. (package:flutter/src/foundation/change_notifier.dart:179:9)
#1 ChangeNotifier.debugAssertNotDisposed (package:flutter/src/foundation/change_notifier.dart:186:6)
#2 ChangeNotifier.dispose (package:flutter/src/foundation/change_notifier.dart:375:27)
#3 MapboxMap.dispose (package:mapbox_maps_flutter/src/mapbox_map.dart:194:11)
#4 _MapWidgetState.dispose (package:mapbox_maps_flutter/src/map_widget.dart:208:18)
```
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず src/mapbox_maps_flutter/src/mapbox_map.dart と src/mapbox_maps_flutter/src/map_widget.dart の破棄処理の経路を読み、リンクされた再現手順と Gist を使って障害を再現します。MapWidget を含む画面を閉じ、その MapboxMap を破棄しても、報告された use-after-dispose 例外が発生しなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- dart, ios
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100