1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[spidermokey] function spidermonkey_release_all_runtimes

This commit is contained in:
Witold Filipczyk 2024-10-23 16:03:19 +02:00
parent 88fdf42ade
commit 68697e6480
3 changed files with 12 additions and 2 deletions

View File

@ -75,6 +75,14 @@ spidermonkey_runtime_release(void)
} }
} }
void
spidermonkey_release_all_runtimes(void)
{
while (spidermonkey_runtime_refcount > 0) {
spidermonkey_runtime_release();
}
}
/** An ELinks-specific replacement for JS_DefineFunctions(). /** An ELinks-specific replacement for JS_DefineFunctions().
* *
* @relates spidermonkeyFunctionSpec */ * @relates spidermonkeyFunctionSpec */

View File

@ -12,6 +12,7 @@ extern JSContext *main_ctx;
extern long spidermonkey_memory_limit; extern long spidermonkey_memory_limit;
int spidermonkey_runtime_addref(void); int spidermonkey_runtime_addref(void);
void spidermonkey_runtime_release(void); void spidermonkey_runtime_release(void);
void spidermonkey_release_all_runtimes(void);
/** An ELinks-specific replacement for JSFunctionSpec. /** An ELinks-specific replacement for JSFunctionSpec.
* *

View File

@ -160,8 +160,9 @@ spidermonkey_init(struct module *module)
static void static void
spidermonkey_done(struct module *xxx) spidermonkey_done(struct module *xxx)
{ {
if (js_module_init_ok) if (js_module_init_ok) {
spidermonkey_runtime_release(); spidermonkey_release_all_runtimes();
}
} }
static const char * static const char *