forked from qt-creator/qt-creator
According to the old explanation inside makefileParsingFinished() the solution of using sender() can't work reliably in this case. In scenarion where the old, deleted m_makefileParserThread had the same address as newly allocated one we might not detect correctly posted finished() signal of the deleted object. According to QObject::sender() documentation: "The pointer returned by this function becomes invalid if the sender is destroyed", so we can't rely on its value. Instead, add a new done() signal to the MakefileParserThread, which is being emitted from MakefileParserThread thread (i.e. from the thread where MakefileParserThread object lives in). In this way the finished() signal is still posted to the caller's thread, but this time if the MakefileParserThread object is already deleted, the finished() signal will be gone together with the MakefileParserThread object itself, so we also won't receive done() signal anymore. Simplify the internals by using std::unique_ptr. Change-Id: I43be209ecb71539ddefd72e50e9d60bfb43c49cb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
3.4 KiB
3.4 KiB