Skip to content

fix(network_info_plus): fix memory leak and use GUID.toNative() helper#3808

Open
halildurmus wants to merge 1 commit intofluttercommunity:mainfrom
halildurmus:network_info_plus
Open

fix(network_info_plus): fix memory leak and use GUID.toNative() helper#3808
halildurmus wants to merge 1 commit intofluttercommunity:mainfrom
halildurmus:network_info_plus

Conversation

@halildurmus
Copy link
Copy Markdown

Description

This PR brings several improvements to the Windows implementation of network_info_plus:

  • Fixes WlanFreeMemory call where ppInterfaceList was incorrectly passed directly instead of ppInterfaceList.value (the pointer allocated by WlanEnumInterfaces). The outer pointer is now also correctly released with free().
  • Replaces the manual calloc<GUID>() + setGUID() pattern with the more efficient GUID.toNative() helper from package:win32, simplifying GUID pointer creation.
  • Uses const for GET_ADAPTERS_ADDRESSES_FLAGS and HEAP_FLAGS literals to fix analyzer issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant