diff -r 7ace3537a560 -r dcacfd2cd81b src/file.cpp --- a/src/file.cpp Wed Oct 16 23:20:35 2013 +0300 +++ b/src/file.cpp Fri Oct 18 17:47:05 2013 +0300 @@ -281,7 +281,7 @@ void FileLoader::work (int i) { // User wishes to abort, so stop here now. if (aborted()) -{ for (LDObject * obj : m_objs) + { for (LDObject* obj : m_objs) delete obj; m_objs.clear(); @@ -298,7 +298,7 @@ // Trim the trailing newline qchar c; - while ( (c = line[line.length() - 1]) == '\n' || c == '\r') + while (!line.isEmpty() && (c = line[line.length() - 1]) == '\n' || c == '\r') line.chop (1); LDObject* obj = parseLine (line);