Skip to content

Commit

Permalink
library_pthread.js: Ensure transferredCanvasNames is iterable
Browse files Browse the repository at this point in the history
This was first broken back in #17577 and then fixed in #17752.

I then broke it again in #22545 (yay!) (see #22620).

This time I will include a test to ensure this doesn't happen again.
  • Loading branch information
sbc100 committed Sep 25, 2024
1 parent 77e24ae commit 77435b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/library_pthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ var LibraryPThread = {
transferredCanvasNames = '{{{ OFFSCREENCANVASES_TO_PTHREAD }}}';
} else
#endif
transferredCanvasNames &&= UTF8ToString(transferredCanvasNames).trim();
transferredCanvasNames &&= transferredCanvasNames.split(',');
// Note: UTF8ToString(0) will return the empty string.
transferredCanvasNames = UTF8ToString(transferredCanvasNames).trim().split(',';
#if GL_DEBUG
dbg(`pthread_create: transferredCanvasNames="${transferredCanvasNames}"`);
#endif
Expand Down

0 comments on commit 77435b0

Please sign in to comment.