Application closed after QNetworkManager::get (Release, after deployment by mingw32)
Hi guys.
I've got issue as in topic, after deployment (I used windeployqt) my application
exits immediately when QNetworkManager::get() method is called.
That problem occurs on only one computer.
Code:
this->_versionUrl = url.value(key).toString();
...
this->_versionRequest.
setUrl(QUrl(this
->_versionUrl
));
...
void Patcher::request(const QNetworkRequest &request)
{
this->log(tr("Starting request: %1").arg(request.url().toString()));
this->_reply = this->_manager->get(request);
this->log(tr("After GET"));
this->connect(this->_reply, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(error(QNetworkReply::NetworkError)));
this->connect(this->_reply, SIGNAL(finished()),
this, SLOT(finished()));
this->connect(this->_reply, SIGNAL(downloadProgress(qint64,qint64)),
this, SLOT(updateProgressBar(qint64,qint64)));
}
When I run my application directly after compilation, everything works fine.
My deployment folder contains following files:
Code:
│ icudt53.dll
│ icuin53.dll
│ icuuc53.dll
│ libgcc_s_dw2-1.dll
│ libstdc++-6.dll
│ libwinpthread-1.dll
│ patcher.ini
│ Qt5Core.dll
│ Qt5Gui.dll
│ Qt5Network.dll
│ Qt5SerialPort.dll
│ Qt5Svg.dll
│ Qt5Widgets.dll
│ qt_ca.qm
│ qt_cs.qm
│ qt_de.qm
│ qt_fi.qm
│ qt_hu.qm
│ qt_it.qm
│ qt_ja.qm
│ qt_lv.qm
│ qt_ru.qm
│ qt_sk.qm
│ qt_uk.qm
│ quazip.dll
│ MyApp.exe
│ updater.log
│ zlib1.dll
│
├───bearer
│ qgenericbearer.dll
│ qnativewifibearer.dll
│
├───iconengines
│ qsvgicon.dll
│
├───imageformats
│ qdds.dll
│ qgif.dll
│ qicns.dll
│ qico.dll
│ qjp2.dll
│ qjpeg.dll
│ qmng.dll
│ qsvg.dll
│ qtga.dll
│ qtiff.dll
│ qwbmp.dll
│ qwebp.dll
│
├───platforms
│ qminimal.dll
│ qoffscreen.dll
│ qwindows.dll
Re: Application closed after QNetworkManager::get (Release, after deployment by mingw
What is the contents of the _reply member variable after the get request?
Also:
- Can you show the code for your error, finished, and updateProgressBar slots?
- What is the stack trace after the crash?
Re: Application closed after QNetworkManager::get (Release, after deployment by mingw
Quote:
Can you show the code for your error, finished, and updateProgressBar slots?
Code:
void Patcher
::log(const QString &state
) {
QFile logFile
("updater.log");
{
stream <<
QDateTime::currentDateTime().
toString("dd.MM.yyyy:hh:mm:ss.zzz") << " " << state
<< " pId: " << qApp->applicationPid()
<< "\n";
logFile.close();
}
}
void Patcher::error(QNetworkReply::NetworkError)
{
this->log(this->_reply->errorString());
exit(-2);
}
void Patcher::finished()
{
this->log(tr("Reply finished. Url: %1").arg(this._reply->url().toString()));
...
// some processing inside
}
void Patcher::updateProgressBar(qint64 read, qint64 total)
{
this->log(tr("Uptade progress bar %1 / %2")
this->ui->progressBar->setMaximum(total);
this->ui->progressBar->setValue(read);
}
Quote:
What is the stack trace after the crash?
It doesn't crash the application. App simple turns off when QNAM get is requested.
I've added Google Breakpad into my project from following tutorial:
https://github.com/JPNaude/dev_notes...eakpad-with-Qt
And it doesn't create any minidump file.
Last log from "updater.log" is "Starting request: http://url.to.my/web/page.file".
PS. On mine machine and some VMs problem has no occured.