I would pass a reference for your QSettings object to func2 rather than allocate a 2nd instance on the stack in func2. Doesn't appear to be related to your lock file issue, but I believe @d_stranz post explains the behavior you're seeing.