mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Fix crash on exit in YACReader. The problem was the default texture in the flow being deleted more than once.
This commit is contained in:
parent
c490e48c00
commit
7e106aedd9
@ -165,6 +165,8 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
int ret = app.exec();
|
int ret = app.exec();
|
||||||
|
|
||||||
|
delete mwv;
|
||||||
|
|
||||||
//Configuration::getConfiguration().save();
|
//Configuration::getConfiguration().save();
|
||||||
|
|
||||||
YACReader::exitCheck(ret);
|
YACReader::exitCheck(ret);
|
||||||
|
@ -1341,8 +1341,20 @@ YACReaderPageFlowGL::~YACReaderPageFlowGL()
|
|||||||
this->killTimer(timerId);
|
this->killTimer(timerId);
|
||||||
//worker->deleteLater();
|
//worker->deleteLater();
|
||||||
rawImages.clear();
|
rawImages.clear();
|
||||||
for(int i = 0;i<numObjects;i++){
|
|
||||||
delete(images[i].texture);
|
//TODO: remove checking for a valid context
|
||||||
|
//checking is needed because of this bug this bug: https://bugreports.qt.io/browse/QTBUG-60148
|
||||||
|
if (this->context() != nullptr && this->context()->isValid())
|
||||||
|
{
|
||||||
|
for(int i = 0; i<numObjects; i++) {
|
||||||
|
if (images[i].texture != defaultTexture) {
|
||||||
|
delete(images[i].texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defaultTexture != nullptr) {
|
||||||
|
delete defaultTexture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user