mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #2083 - Part 5: Fix memory leak in RegExpObject.
Based on Mozilla bug 1345177.
This commit is contained in:
parent
9824659d3c
commit
b7e4530861
2 changed files with 2 additions and 1 deletions
|
|
@ -975,6 +975,8 @@ RegExpShared::discardJitCode()
|
|||
void
|
||||
RegExpShared::finalize(FreeOp* fop)
|
||||
{
|
||||
for (auto& comp : compilationArray)
|
||||
js_free(comp.byteCode);
|
||||
for (size_t i = 0; i < tables.length(); i++)
|
||||
js_free(tables[i]);
|
||||
tables.~JitCodeTables();
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ class RegExpShared : public gc::TenuredCell
|
|||
uint8_t* byteCode;
|
||||
|
||||
RegExpCompilation() : byteCode(nullptr) {}
|
||||
~RegExpCompilation() { js_free(byteCode); }
|
||||
|
||||
bool compiled(ForceByteCodeEnum force = DontForceByteCode) const {
|
||||
return byteCode || (force == DontForceByteCode && jitCode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue