balsam: Reset the QML id allocator between assets
writeQml() allocates component-unique ids through three process-wide
statics that were never cleared, one of them keyed by node pointer.
balsam converts every positional argument in the same process and each
scene releases its nodes before the next one is built, so a new node
allocated at a freed node's address takes a false hit and is handed the
previous asset's id. Only the first asset of a run comes out correct;
the rest get ids belonging to their predecessor throughout, so the
generated component either fails to load or binds to the wrong objects.
Reset all three from one helper called by both exported entry points
that allocate ids, writeQml() and writeQmlComponent(), the latter being
exposed to the same hazard whenever the material editor rebuilds its
scene between exports. A test converts one asset twice in a single
process and requires the two generated components to be identical.
Pick-to: 6.12 6.11 6.8
Change-Id: I4825fc2a6fa2d34fecc1a5d31b4400e24d7d550a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>