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

Change semantics or remove BufferFinalizer #47

Closed
s1hofmann opened this issue Jan 23, 2021 · 0 comments · Fixed by #60
Closed

Change semantics or remove BufferFinalizer #47

s1hofmann opened this issue Jan 23, 2021 · 0 comments · Fixed by #60
Labels
enhancement New feature or request

Comments

@s1hofmann
Copy link
Member

s1hofmann commented Jan 23, 2021

Short overview
Semantics of BufferFinalizer are unspecified. We should either get rid of it or fix their behavior.

Detailed description
Buffer finalizers are called when a Buffer gets destroyed and it's used by libnut to deal with underlying memory.
However, since the underlying memory is allocated via malloc and the BufferFinalizer calls delete on it, we might run into trouble since this is unspecified behaviour.

We could get rid of these finalizers by using Buffer::Copy and free allocated memory ourselfs, or we just update the finalizer to use free

@s1hofmann s1hofmann added the enhancement New feature or request label Jan 23, 2021
@s1hofmann s1hofmann changed the title Get rid of BufferFinalizer Change semantics or remove BufferFinalizer Jan 25, 2021
@s1hofmann s1hofmann linked a pull request Mar 22, 2021 that will close this issue
s1hofmann added a commit that referenced this issue Dec 11, 2021
* (#47) Deleted src/buffer_finalizer.h

* (#47) Switched to using Buffer::Copy

* Fix for screen highlight window minimized intead close

* Create LICENSE.md

* Add Helper Methods for calculating the required absolute position on the screen

* Refactor moveMouse to use SendInput for absolute position movements on windows

* Indentation

* Add Coord constant

* Squash x and y coord methods
Make Absolute coord calculation return MMPoint

* Call coord calculator with MMPoint

* Correct Types and Return values

* Import for getMainDisplaySize

* Bugfix for lost co-ordinate precision

* (nut-tree/nut.js#249) Enable DPI awareness when fetching screen content to always capture the full screen content even with scaling applied

* (nut-tree/nut.js#249) Refactor scale calculation to work correctly with custom regions

* (nut-tree/nut.js#306) Specify supported os and cpu in package.json to enable Apple Silicon

* Remove scan code block

* Release/v2.1.3 (#88)

* Update changelog for v2.1.3

* Release v2.1.3

Co-authored-by: Gyula Madarasz <[email protected]>
Co-authored-by: Reiss Cashmore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant