mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Merge pull request #63 from YACReader/feature/fix_ogl_texture_destruction
Fix YACReaderPageFlowGL texture destruction
This commit is contained in:
commit
ad33a73f2f
@ -1266,22 +1266,23 @@ YACReaderPageFlowGL::YACReaderPageFlowGL(QWidget *parent, struct Preset p)
|
|||||||
YACReaderPageFlowGL::~YACReaderPageFlowGL()
|
YACReaderPageFlowGL::~YACReaderPageFlowGL()
|
||||||
{
|
{
|
||||||
this->killTimer(timerId);
|
this->killTimer(timerId);
|
||||||
//worker->deleteLater();
|
|
||||||
rawImages.clear();
|
rawImages.clear();
|
||||||
|
|
||||||
//TODO: remove checking for a valid context
|
makeCurrent();
|
||||||
//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) {
|
for(auto image : images) {
|
||||||
delete defaultTexture;
|
if (image.texture != defaultTexture) {
|
||||||
|
image.texture->destroy();
|
||||||
|
delete image.texture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defaultTexture != nullptr) {
|
||||||
|
defaultTexture->destroy();
|
||||||
|
delete defaultTexture;
|
||||||
|
}
|
||||||
|
|
||||||
|
doneCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user