{"action":"closed","issue":{"url":"https://api.github.com/repos/dg0yt/playground/issues/29","labels_url":"https://api.github.com/repos/dg0yt/playground/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/dg0yt/playground/issues/29/comments","events_url":"https://api.github.com/repos/dg0yt/playground/issues/29/events","html_url":"https://github.com/dg0yt/playground/issues/29","id":103791687,"number":29,"title":"Leaving Track::loadFrom without closing file","user":{"login":"dg0yt","id":13567791,"avatar_url":"https://avatars.githubusercontent.com/u/13567791?v=3","gravatar_id":"","url":"https://api.github.com/users/dg0yt","html_url":"https://github.com/dg0yt","followers_url":"https://api.github.com/users/dg0yt/followers","following_url":"https://api.github.com/users/dg0yt/following{/other_user}","gists_url":"https://api.github.com/users/dg0yt/gists{/gist_id}","starred_url":"https://api.github.com/users/dg0yt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dg0yt/subscriptions","organizations_url":"https://api.github.com/users/dg0yt/orgs","repos_url":"https://api.github.com/users/dg0yt/repos","events_url":"https://api.github.com/users/dg0yt/events{/privacy}","received_events_url":"https://api.github.com/users/dg0yt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dg0yt/playground/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/dg0yt/playground/labels/invalid","name":"invalid","color":"e6e6e6"},{"url":"https://api.github.com/repos/dg0yt/playground/labels/sourceforge","name":"sourceforge","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-07-03T21:23:35Z","updated_at":"2015-08-28T22:01:11Z","closed_at":"2015-08-28T22:01:11Z","body":"I'm not sure if the bool Track::loadFrom(...) function in gps_track.cpp should be modified so that for dfx and osm files (and every unsupported filetype!) the file handle is closed before the function returns with false.\r\n\r\nProposal:\r\n\r\n```~~\r\nbool Track::loadFrom(const QString& path, bool project_points, QWidget* dialog_parent)\r\n{\r\n        bool res=false;\r\n\tQFile file(path);\r\n\tif (!file.open(QIODevice::ReadOnly | QIODevice::Text))\r\n\t\treturn false;\r\n\t\r\n\tclear();\r\n\r\n\tif (path.endsWith(\".gpx\", Qt::CaseInsensitive))\r\n\t{\r\n\t\tres=loadFromGPX(&file, project_points, dialog_parent);\r\n\t}\r\n\telse if (path.endsWith(\".dxf\", Qt::CaseInsensitive))\r\n\t{\r\n\t\tres=loadFromDXF(&file, project_points, dialog_parent);\r\n\t}\r\n\telse if (path.endsWith(\".osm\", Qt::CaseInsensitive))\r\n\t{\r\n\t\tres=loadFromOSM(&file, project_points, dialog_parent);\r\n\t}\r\n\r\n\tfile.close();\r\n\treturn res;\r\n}\r\n```~~\n\nReported by: dl3sdo\n\nOriginal Ticket: [oorienteering/tickets/332](https://sourceforge.net/p/oorienteering/tickets/332)"}}