sciter-sdk / pysciter

Python bindings for Sciter
https://sciter.com
MIT License
396 stars 40 forks source link

#72 Fixed memory leak #73

Closed AlecHaring closed 2 years ago

AlecHaring commented 2 years ago

Fixed memory leak detailed in issue #72.

Added a new wrapper class named value_array for SCITER_VALUE arrays. It makes it so we can keep track of them throughout their entire lifecycle and clear them from memory once they no longer are in use.

It also simplifies how you interact with them. Instead of:

sciter_array = (SCITER_VALUE * 5)()
sv = sciter.Value(value)
sv.copy_to(sciter_array[0])

you can just do:

sciter_array = value_array(length=5)
sciter_array[0] = value