Closed Bug 651973 Opened 13 years ago Closed 13 years ago

RegExp not released on error path in createObjectNoStatics

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mwu, Assigned: mwu)

Details

(Keywords: memory-leak, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

      No description provided.
Attachment #527648 - Flags: review?(cdleary)
Comment on attachment 527648 [details] [diff] [review]
Release RegExp on error

Nice catch! Only nit is that I think SpiderMonkey style prefers combining with the above test a la:

    if (!obj ||
        !obj->initRegExp(cx, re.get())) {
        // common cleanup code
    }
Attachment #527648 - Flags: review?(cdleary) → review+
...except combine the two conditions to one line, like:

if (!obj || !obj->initRegExp(cx, re.get()))

because it all fits on one line, in 99ish characters.
http://hg.mozilla.org/tracemonkey/rev/152ef9c8b2bb

Hm I forgot to make it one line.. sorry about that!

It looks sorta nice on two lines IMO anyway..
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/152ef9c8b2bb
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: