-
-
Notifications
You must be signed in to change notification settings - Fork 54
fix: fix memory leaks #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
we always should return a result or else cordova is leaking callbacks on the js side
| try (FileOutputStream out = new FileOutputStream(installation)) { | ||
| out.write(bytes); | ||
| logger.info("Successfully captured envelope."); | ||
| callbackContext.success(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not move it to line 156 so it will always invoke callbackContext.success(); for all the cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be sure, you want me to also replace all success plugin results (not in a try block, to avoid double call in case of catched errors) with the invokation at line 156 ?
| callbackContext.success(); | ||
| } catch (Exception e) { | ||
| logger.info("Error writing envelope."); | ||
| callbackContext.error("Error writing envelope."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might also be a good idea to return false here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, because as I understand it, the execute method is only supposed to return false if the requested action is not found.
(because when returning false cordova is sending its own plugin result)
|
Thank you @Athorcis for spotting this issue! I left a small suggestion on the java code but other than that it looks good! |
|
@lucas-zimerman I have questions about the suggestions |
we always should return a result or else cordova is leaking callbacks on the js side
it become visible with numerous calls to addBreadcrumb