node-gtk icon indicating copy to clipboard operation
node-gtk copied to clipboard

fix(value): handle transfer-full, in arguments properly

Open peat-psuwit opened this issue 3 years ago • 6 comments

This is done by making V8ToGIArgument() accept the transfer status and react accordingly. I does not make the new argument optional; this forces me into thinking about the appropriate value to put in for various callsites of this function.

Closes #303

peat-psuwit avatar Jun 18 '21 16:06 peat-psuwit

@peat-psuwit sorry for the delay, was traveling a bit this summer.

Overall this looks good, one thing though. For all the changes it makes, the PR only has a single test. Is it really the only case affected by these changes?

romgrk avatar Sep 28 '21 00:09 romgrk

For all the changes it makes, the PR only has a single test. Is it really the only case affected by these changes?

Well, the thing is that I can't find more APIs in GStreamer, GLib or GTK that would be affected by this. I would prefer to have at least an equivalent test but for GObject. I considered adding an introspectable library for testing, but I'm not sure if it can be done using node-gyp system

peat-psuwit avatar Sep 28 '21 07:09 peat-psuwit

Alright. There is #269 open to add libgimarshallingtest which does that kind of stuff, we can add more tests once the lib is used for testing. I'll merge as soon as you fix the last two nitpicks :]

romgrk avatar Sep 29 '21 04:09 romgrk

How is this one related to #302? Do you want to include the memory ownership thing here?

romgrk avatar Oct 02 '21 18:10 romgrk

It's a different problem. This one try to prevent use-after-free for transfer-full, in argument, while #302 concerns about memory leakage. Both are memory problems, but of different kinds...

This one can be merged without the fix for #302.

peat-psuwit avatar Oct 02 '21 18:10 peat-psuwit

Got it. You can fix the last comment up here and it's ready for merging.

romgrk avatar Oct 02 '21 20:10 romgrk