Commit 63856e25 authored by Matthias Möller's avatar Matthias Möller

- using QImage instead of QPixmap getting outside of X11 memory in multithreading path

fixes video crash under X11

refs #1223


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15732 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0e77c51a
......@@ -988,7 +988,6 @@ public:
public:
void writeImageAsynchronously(QPixmap* _pixmap, const QString _name);
void writeImageAsynchronously(QImage* _image, const QString _name);
private:
......
......@@ -480,7 +480,7 @@ void CoreWidget::applicationSnapshot() {
suggest += format;
// Write image asynchronously
QPixmap* pic = new QPixmap(QPixmap::grabWindow( winId() ));
QImage* pic = new QImage(QPixmap::grabWindow( winId() ).toImage());
writeImageAsynchronously(pic, suggest);
}
......@@ -789,25 +789,6 @@ void CoreWidget::applicationSnapshotName(QString _name) {
snapshotCounter_ = 0;
}
void writeImageQPixmap(QPixmap* _pixmap, const QString _name) {
_pixmap->save(_name);
delete _pixmap;
}
void CoreWidget::writeImageAsynchronously(QPixmap* _pixmap, const QString _name) {
QFuture<void>* future = new QFuture<void>();
*future = QtConcurrent::run(writeImageQPixmap, _pixmap, _name);
QFutureWatcher<void>* watcher = new QFutureWatcher<void>();
watcher->setFuture(*future);
watcher_garbage_.insert(std::pair<QFutureWatcher<void>*,QFuture<void>*>(watcher, future));
connect(watcher, SIGNAL(finished()), this, SLOT(delete_garbage()));
}
void writeImageQImage(QImage* _image, const QString _name) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment