Fix a memory management issues with the name map in internal classes
authorSimon Hausmann <simon.hausmann@digia.com>
Sun, 23 Jun 2013 11:35:17 +0000 (13:35 +0200)
committerLars Knoll <lars.knoll@digia.com>
Sun, 23 Jun 2013 19:36:08 +0000 (21:36 +0200)
commit6a9badef274b55ae0ed06ca96cbe035b445fcf5b
treef4a47ffa777c852e5139e034d7a591c33d41db0f
parent2d747f3be31daed1a56375fb50e5c019570a1006
Fix a memory management issues with the name map in internal classes

The string pointer we store in the nameMap is not marked directly, i.e. our
class hierarchy doesn't have a recursive mark() function. So we must otherwise
make sure that that string is marked, otherwise we get dangling pointers that
are likely to point to _other_ strings later. This is hard to reproduce, but it
does happen with MM_AGGRESSIVE_GC=1 and the singletonType test in
qqmlecmascript, when due to the dangling pointer we end up using the wrong
property name in freeze() when iterating through the name map.

This patch fixes that by storing the actual identifier string, that's
guaranteed to get marked.

Change-Id: I28d1a2d2f56fe3abf692229ba008af8b0789189e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4internalclass.cpp