SupinePandora43 / UltralightNet

.NET bindings for Ultralight next-gen HTML renderer
https://github.com/SupinePandora43/UltralightNet
MIT License
62 stars 10 forks source link

Use `using` to not rely on GC #52

Closed SupinePandora43 closed 1 year ago

SupinePandora43 commented 2 years ago

There's a lot of single-use new JSString(...). By using

using(JSString jsString = new(...)){
    NativeCall(jsString.Handle);
}

Dispose method will be called => finalizer supressed => reduce GC usage.

68 .