-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Steps to Reproduce
- Get the
multiple_flutterssample. - Add
cameraandvideo_playerto pubspec, copy the camera example code to a separate file in lib (camera.dart) andrunAppthis widget inmainfunction (shown in below details) function. - Open the
multiple_flutters_iosapp in XCode and run the app. - In-App: Click Next (opens camera example)
- In XCode: Click on "Debug Memory Graph" (small graph-like icon with 3 nodes at the bottom bar). In the "Show the Debug navigator" section on the left, search for
FlutterEngine. Notice there is oneFlutterEnginein memory (figure 1). - In XCode: Click on the "Continue program execution" button (play button on the bottom bar)
- In-App: press Back
- repeat step 5, Notice that the same
FlutterEngineis still active. - Repeat steps 4-9, it'll add a
FlutterEngineeach time.
main
import 'package:camera/camera.dart'; // +
import 'package:multiple_flutters_module/camera.dart'; // +
// other imports
List<CameraDescription> cameras = <CameraDescription>[]; // +
@pragma('vm:entry-point')
Future<void> main() async { // +-
// Fetch the available cameras before initializing the app. // +
try { // +
WidgetsFlutterBinding.ensureInitialized(); // +
cameras = await availableCameras(); // +
} on CameraException catch (e) { // +
logError(e.code, e.description); // +
} // +
runApp(CameraApp()); // +-
} // +-
// rest of the codeExpected results:
There should be no active FlutterEngine instances.
Actual results:
There is one active FlutterEngine instance.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team


