Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Julian Steenbakker
2025-04-18 23:06:34 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4b7b73c21ac4505021378213bab4925ca23a3129
4b7b73c2
1 parent
9149c425
imp: add link for hot-restart issue, add macos check for textureId
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
lib/src/mobile_scanner.dart
macos/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift
lib/src/mobile_scanner.dart
View file @
4b7b73c
...
...
@@ -262,12 +262,13 @@ class _MobileScannerState extends State<MobileScanner>
// If debug mode is enabled, stop the controller first before starting it.
// If a hot-restart is initiated, the controller won't be stopped, and because
// there is no way of knowing if a hot-restart has happened, we must assume
// every start is a hot-restart.
// every start is a hot-restart. Related issue:
// https://github.com/flutter/flutter/issues/10437
if
(
kDebugMode
)
{
final
platformInterface
=
MobileScannerPlatform
.
instance
;
if
(
MobileScannerPlatform
.
instance
case
final
MethodChannelMobileScanner
implementation
)
{
if
(
MobileScannerPlatform
.
instance
case
final
MethodChannelMobileScanner
implementation
)
{
try
{
await
platformInterface
.
stop
(
force:
true
);
await
implementation
.
stop
(
force:
true
);
}
catch
(
e
)
{
// Don't do anything if the controller is already stopped.
debugPrint
(
'
$e
'
);
...
...
macos/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift
View file @
4b7b73c
...
...
@@ -496,6 +496,10 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
}
private
func
releaseTexture
()
{
if
(
textureId
==
nil
)
{
return
}
registry
.
unregisterTexture
(
textureId
)
textureId
=
nil
}
...
...
Please
register
or
login
to post a comment