Browse Source

Merge pull request #12427 from Chocobo1/io

Avoid inefficient behavior
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
26941a5b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/base/utils/io.cpp

2
src/base/utils/io.cpp

@ -41,10 +41,12 @@ Utils::IO::FileDeviceOutputIterator::FileDeviceOutputIterator(QFileDevice &devic @@ -41,10 +41,12 @@ Utils::IO::FileDeviceOutputIterator::FileDeviceOutputIterator(QFileDevice &devic
Utils::IO::FileDeviceOutputIterator::~FileDeviceOutputIterator()
{
if (m_buffer.use_count() == 1) {
if (m_device->error() == QFileDevice::NoError)
m_device->write(*m_buffer);
m_buffer->clear();
}
}
Utils::IO::FileDeviceOutputIterator &Utils::IO::FileDeviceOutputIterator::operator=(const char c)
{

Loading…
Cancel
Save