Skip to content

Commit

Permalink
Refactor dispose logic in PencilKit and PencilKitController
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-szeto committed Oct 24, 2024
1 parent 4eaee86 commit 0af7f06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/pencil_kit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _PencilKitState extends State<PencilKit> {

@override
void dispose() {
_controller?._dispose(); // Dispose of the controller
_controller?.dispose(); // Dispose of the controller
_controller = null;
super.dispose();
}
Expand Down Expand Up @@ -270,7 +270,7 @@ class PencilKitController {
_channel.invokeMethod('loadBase64Data', base64Data);

/// Dispose the controller and release resources
void _dispose() {
void dispose() {
_channel.invokeMethod('dispose');
_channel.setMethodCallHandler(null); // Remove the method call handler
}
Expand Down

0 comments on commit 0af7f06

Please sign in to comment.