romgrk / node-gtk

GTK+ bindings for NodeJS (via GObject introspection)
MIT License
494 stars 41 forks source link

node-gtk doesn't correctly handle transfer-full, in argument #304

Open peat-psuwit opened 3 years ago

peat-psuwit commented 3 years ago

While investing some code for #302, I noticed that node-gtk doesn't seem to take argument's transfer mode into account while filing GIArgument. So, I wrote a test case to test that, and it seems like it's the case.

    let gstPromise = new Gst.Promise();
    let structure = Gst.Structure.newEmpty('test');
    gstPromise.reply(structure); // gstPromise now owns backing GstStructure.

    gstPromise = null;
    global.gc();

    // Causes an assertion and return false
    console.log(structure.isEqual(structure));

I've turned this into a test case for node-gtk in #303, so when it's fixed, there will be a test case ready.