soul_rebel
6th April 2006, 17:38
i have subclasses kprocess and want to buffer output in a qstringlist.
when output is received i do this:
m1.lock();
QStringList temp = QStringList::split('\n', QString::fromLatin1(buffer, buflen));
for ( QStringList::Iterator it = temp.begin(); it != temp.end(); ++it )
mStdoutBuffer.append(*it);
m1.unlock(); and when the buffer is read this code is exeuted:
/// reads first line from Buffer and then removes it so content "moves up"
if (canReadLineStdout() && ( m1.tryLock()))
{
QString Buffer = mStdoutBuffer.first();
QStringList::Iterator it = mStdoutBuffer.begin();
mStdoutBuffer.remove(*it);
m1.unlock();
return (Buffer);
} else
return (""); but i get
QGVector::remove: Index 1343941632 out of range
QGVector::insert: Index 1343941632 out of range
what am i doing wrong? (the program mostly doesnt crash but something isnt well for sure)
thanks
when output is received i do this:
m1.lock();
QStringList temp = QStringList::split('\n', QString::fromLatin1(buffer, buflen));
for ( QStringList::Iterator it = temp.begin(); it != temp.end(); ++it )
mStdoutBuffer.append(*it);
m1.unlock(); and when the buffer is read this code is exeuted:
/// reads first line from Buffer and then removes it so content "moves up"
if (canReadLineStdout() && ( m1.tryLock()))
{
QString Buffer = mStdoutBuffer.first();
QStringList::Iterator it = mStdoutBuffer.begin();
mStdoutBuffer.remove(*it);
m1.unlock();
return (Buffer);
} else
return (""); but i get
QGVector::remove: Index 1343941632 out of range
QGVector::insert: Index 1343941632 out of range
what am i doing wrong? (the program mostly doesnt crash but something isnt well for sure)
thanks