NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
519 stars 135 forks source link

fix: minor memory leaks #1747

Closed edusperoni closed 1 year ago

edusperoni commented 1 year ago

Description

Fixes 2 minor memory leaks:

  1. when creating code cache, delete the CachedData (it's created with BufferNotOwned by default, so we're just deleting the structure we won't use anymore)

  2. When using DesugaredInterfaceCompanionClassNameResolver, instantiate it statically, so we don't need to delete anything. We could even make this class static. Also changed it to const std::string& to avoid string copying. Overall, this was leaking 24 bytes per invocation.