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

fix(napi): do not call release tsfn in Drop when ref count is 0 #522

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 31, 2021

Before fix:

napi4 › threadsafe_function.ts › tsfn dua instance

  test_module/__test__/napi4/threadsafe_function.spec.ts:95

   94:   }                                                            
   95:   t.notThrows(() => {                                          
   96:     execSync(`node ${join(__dirname, 'tsfn-dua-instance.js')}`)

  Function threw:

  Error {
    output: [
      null,
      Buffer @Uint8Array [],
      Buffer @Uint8Array [],
    ],
    pid: 26327,
    signal: 'SIGABRT',
    status: null,
    stderr: Buffer @Uint8Array [],
    stdout: Buffer @Uint8Array [],
    message: 'Command failed: node /Users/longyinan/workspace/github/napi-rs/test_module/__test__/napi4/tsfn-dua-instance.js',
  }

  › test_module/__test__/napi4/threadsafe_function.spec.ts:96:5
  › test_module/__test__/napi4/threadsafe_function.spec.ts:95:5

  ─

  1 test failed

Close #518

@Brooooooklyn Brooooooklyn merged commit b8310e3 into main Mar 31, 2021
@Brooooooklyn Brooooooklyn deleted the tsfn-release-error branch March 31, 2021 13:41
@williamluke4
Copy link

Thanks @Brooooooklyn

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

Successfully merging this pull request may close these issues.

Holding more than one threadsafe function causes SIGABRT on Drop
2 participants