Add missing JSAutoRequest calls. (hopefully all of them have been spotted now)

Patch by echotangoecho, refs #4053

This was SVN commit r18730.
This commit is contained in:
Itms
2016-09-18 09:34:45 +00:00
parent 184d64cdc8
commit caef42084d
8 changed files with 40 additions and 9 deletions
+4 -1
View File
@@ -91,8 +91,11 @@ JS::Value JSI_VFS::BuildDirEntList(ScriptInterface::CxPrivate* pCxPrivate, const
int flags = recurse ? vfs::DIR_RECURSIVE : 0;
JSContext* cx = pCxPrivate->pScriptInterface->GetContext();
JSAutoRequest rq(cx);
// build array in the callback function
BuildDirEntListState state(pCxPrivate->pScriptInterface->GetContext());
BuildDirEntListState state(cx);
vfs::ForEachFile(g_VFS, path, BuildDirEntListCB, (uintptr_t)&state, filter, flags);
return OBJECT_TO_JSVAL(state.filename_array);