1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Fix typo: destory -> destroy

This commit is contained in:
Calvin Rose 2020-02-28 09:04:28 -06:00
parent 6b093bdcca
commit b17bf259f7

View File

@ -186,7 +186,7 @@ static JanetMailboxPair *make_mailbox_pair(JanetMailbox *original) {
return pair; return pair;
} }
static void destory_mailbox_pair(JanetMailboxPair *pair) { static void destroy_mailbox_pair(JanetMailboxPair *pair) {
janet_mailbox_ref(pair->original, -1); janet_mailbox_ref(pair->original, -1);
janet_mailbox_ref(pair->newbox, -1); janet_mailbox_ref(pair->newbox, -1);
free(pair); free(pair);
@ -471,13 +471,13 @@ static int thread_worker(JanetMailboxPair *pair) {
} }
/* Normal exit */ /* Normal exit */
destory_mailbox_pair(pair); destroy_mailbox_pair(pair);
janet_deinit(); janet_deinit();
return 0; return 0;
/* Fail to set something up */ /* Fail to set something up */
error: error:
destory_mailbox_pair(pair); destroy_mailbox_pair(pair);
janet_eprintf("\nthread failed to start\n"); janet_eprintf("\nthread failed to start\n");
janet_deinit(); janet_deinit();
return 1; return 1;
@ -566,7 +566,7 @@ static Janet cfun_thread_new(int32_t argc, Janet *argv) {
JanetMailboxPair *pair = make_mailbox_pair(janet_vm_mailbox); JanetMailboxPair *pair = make_mailbox_pair(janet_vm_mailbox);
JanetThread *thread = janet_make_thread(pair->newbox, encode); JanetThread *thread = janet_make_thread(pair->newbox, encode);
if (janet_thread_start_child(pair)) { if (janet_thread_start_child(pair)) {
destory_mailbox_pair(pair); destroy_mailbox_pair(pair);
janet_panic("could not start thread"); janet_panic("could not start thread");
} }