4
0
mirror of https://github.com/QuasarApp/qthttpserver.git synced 2025-05-11 17:09:44 +00:00

Fix compilation with gcc 4.8

GCC 4.8 doesn't like using QPointers in signal connections.

Fixes: QTBUG-79345
Change-Id: I7cd4d79eee3ce7f07874e13f5ecfa9925090d68d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Mikhail Svetkin 2019-10-21 21:37:32 +02:00
parent 3eebefcd27
commit e35fdc4763

@ -75,16 +75,16 @@ struct IOChunkedTransfer
IOChunkedTransfer(QIODevice *input, QIODevice *output) :
source(input),
sink(output),
bytesWrittenConnection(QObject::connect(sink, &QIODevice::bytesWritten, [this] () {
bytesWrittenConnection(QObject::connect(sink.data(), &QIODevice::bytesWritten, [this] () {
writeToOutput();
})),
readyReadConnection(QObject::connect(source, &QIODevice::readyRead, [this] () {
readyReadConnection(QObject::connect(source.data(), &QIODevice::readyRead, [this] () {
readFromInput();
}))
{
Q_ASSERT(!source->atEnd()); // TODO error out
QObject::connect(sink, &QObject::destroyed, source, &QObject::deleteLater);
QObject::connect(source, &QObject::destroyed, [this] () {
QObject::connect(sink.data(), &QObject::destroyed, source, &QObject::deleteLater);
QObject::connect(source.data(), &QObject::destroyed, [this] () {
delete this;
});
readFromInput();