[Development] Question about QCoreApplicationData::*_libpaths

Kevin Kofler kevin.kofler at chello.at
Wed Jan 20 23:15:24 CET 2016

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

More information about the Development mailing list