Marc Mutz wrote:
> QString foo() { return QStringLiteral("foo"); }
> QString bar() { return Q3DeepCopy<QString>(QStringLiteral("foo")); }
> 
> You will _never_ have the plugin-unloading problem with 'bar', only with
> 'foo', and the reason is CoW: suggesting value semantics where there
> aren't any.

No, the issue is with the specific (ab)use of CoW by QStringLiteral, that 
inserts a pointer to a data segment (rather than to the heap as normal) into 
the CoW container.

        Kevin Kofler

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to