Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 11.0.3
-
None
-
Ubuntu 20.04.3 LTS, cmake project
-
-
1c59014d7 (12.0)
Description
When I have an open project and selects "Add New" -> "C/C+" -> "C/C+ Header File" qtcreator hangs.
I have debuged this and it is hanging in source file src/plugins/[projectexplorer/projectnodes.cpp |https://github.com/qt-creator/qt-creator/tree/master/src/plugins/projectexplorer]at line 351-352. That is, it is stuck in:
...
while ((!fi.exists() || !fi.isDir()) && !fi.isRoot())
fi.setFile(fi.absolutePath());
...
The context is that fi.fileName() == fi.absolutePath() (both are empty strings), and thus qtcreator is stuck in the while loop. Adding extra condition to the while loop seems to fix the problem (at least for me):
+ while ((!fi.exists() || !fi.isDir()) && !fi.isRoot() &&
+ (fi.fileName() != fi.absolutePath()))
+ fi.setFile(fi.absolutePath());
Hope this helps developing the tool
Attachments
For Gerrit Dashboard: QTCREATORBUG-30067 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
526503,2 | PE: Break infinite loop if the location is empty | 12.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |