diff --git a/CMakeLists.txt b/CMakeLists.txt index 83b7455..3ce1e49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) -ADD_COMPILE_OPTIONS($<$:/MP>) +ADD_COMPILE_OPTIONS($<$:/MP> $<$:$<$:/O2>> $<$:$<$:/O2>>) SET(PROJ_NAME githubpp) PROJECT(${PROJ_NAME}) diff --git a/src/github.cpp b/src/github.cpp index 85f1e64..4215c66 100644 --- a/src/github.cpp +++ b/src/github.cpp @@ -28,9 +28,6 @@ QJsonArray GitHub::releases(const Repository &repo) QString("repos/%1/%2/releases").arg(repo.owner, repo.project), QByteArray(), true); - if (!result.isArray()) { - throw GitHubException(result.object()); - } return result.array(); } @@ -40,9 +37,6 @@ void GitHub::releases(const Repository &repo, request(Method::GET, QString("repos/%1/%2/releases").arg(repo.owner, repo.project), QByteArray(), [callback](const QJsonDocument &result) { - if (!result.isArray()) { - throw GitHubException(result.object()); - } callback(result.array()); }, true); } @@ -144,6 +138,7 @@ void GitHub::request(Method method, const QString &path, const QByteArray &data, [reply, timer, callback](QNetworkReply::NetworkError error) { qDebug("network error %d", error); timer->stop(); + reply->disconnect(); callback(QJsonDocument( QJsonObject({{"network_error", reply->errorString()}}))); reply->deleteLater();