[Development] Question about QCoreApplicationData::*_libpaths

Thiago Macieira thiago.macieira at intel.com
Tue Jan 19 00:41:35 CET 2016


On Monday 18 January 2016 23:11:14 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.

That doesn't mean types without CoW are immune from the problem. There are 
lots of discussion in the std mailing lists about constexpr data, so in the 
future a const std::string could potentially point to .rodata and thus be 
affected by this problem too.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list