[Development] Should QFileSystemWatcher be thread-safe? (Qt 5.8.0)
René J. V. Bertin
rjvbertin at gmail.com
Sat Sep 30 14:54:23 CEST 2017
Konrad Rosenbaum wrote:
> You do know what a thread is - right? ;-)
Yeah, my momma taught me long ago ;)
> Sorry, I'm too lazy/busy to read the source right now to make sure that no
> signal handlers are used here.
No problem, it was just curiosity.
> Apart from this I'd suspect you will still get the SEGV if you do not block
> - even if the frequency changes. This points to you using some kind of
> pointer that is not properly controlled (e.g. sending a signal to a QFSW
> that is already deleted).
I think it was false alarm. I used a lambda expression as slot and must have
misunderstood why the other lambdas in the same function can use '[&]' without
ending up with invalid references in the body. I only need the watcher instance,
so I'm just passing the reference to it explicitly. No more crashing and less
ambiguous anyway :)
More information about the Development
mailing list