Yep, I know, the solution I proposed was also thread safe, but it didn't require a lock/unlock on each function call or extra memory structs around it. Anyway, I stumbled across the home path thingy as a side effect of looking into a different Qt issue (startup time, which is pretty much unrelated to this issue) so I'll leave this (non-)issue for later cause the Qt start up time to me is far more important.
On Sun, Oct 27, 2013 at 11:55 PM, Thiago Macieira <[email protected] > wrote: > On domingo, 27 de outubro de 2013 22:51:59, Jiergir Ogoerg wrote: > > But looking at its source code [1] and since this was a > micro-optimization > > to begin with, I guess it's > > not worth bothering caching the home dir path. > > Since QDir::homePath() needs to be thread-safe, you need to use > Q_GLOBAL_STATIC because it is thread-safe. > > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center > > _______________________________________________ > Development mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/development > >
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
