Skip to content
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

fix find wallets #46

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update WalletManager_findWallets
Do not free if the string returned is empty (it
crashes the library)
MrCyjaneK committed Sep 3, 2024
commit 448dd5557ecceb5c9b3c6be647d29dffe2269bad
4 changes: 3 additions & 1 deletion impls/monero.dart/lib/monero.dart
Original file line number Diff line number Diff line change
@@ -3595,7 +3595,9 @@ String WalletManager_findWallets(WalletManager wm_ptr, {required String path}) {
.cast<Utf8>();
final str = strPtr.toDartString();
calloc.free(path_);
MONERO_free(strPtr.cast());
if (str.isNotEmpty) {
MONERO_free(strPtr.cast());
}
debugEnd?.call('MONERO_WalletManager_findWallets');
return str;
} catch (e) {
4 changes: 3 additions & 1 deletion impls/monero.dart/lib/wownero.dart
Original file line number Diff line number Diff line change
@@ -3230,7 +3230,9 @@ String WalletManager_findWallets(WalletManager wm_ptr, {required String path}) {
.cast<Utf8>();
final str = strPtr.toDartString();
calloc.free(path_);
WOWNERO_free(strPtr.cast());
if (str.isNotEmpty) {
WOWNERO_free(strPtr.cast());
}
debugEnd?.call('WOWNERO_WalletManager_findWallets');
return str;
} catch (e) {