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

gffi finalizer does not return correct value when used from destroy() #101

Open
GoogleCodeExporter opened this issue Aug 23, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

finalizeWith should pass the return value back to destroy as though the C 
closure had been invoked directly.

spotted thusly:

const _close        = new dl.CFunction(ffi.int, "close",        ffi.int);

...
  this.fd   = +fd;
  this.gcFd = fd;       /* keep the boxed fd as a GC root to prevent finalization */
...

    if (this.gcFd.destroy() != 0)
      throw new Error("Could not close socket on fd " + (0+this.fd) + syserr());


The exception was thrown, however truss confirms that the system call returned 
zero.

Original issue reported on code.google.com by wes@page.ca on 11 Dec 2012 at 6:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant