Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.14.1
-
None
-
Windows 10 Pro
Description
Creating QOpenGLWidget on stack or allocating dynamically will not free resources when deleted.
I created one instance of QOpenGLWidget for every newly opened tab in TabWidget.
After destroying them, memory in VRAM was not freed. It takes only a few tabs to get to 2GB of VRAM used without any option to free it.
I tried delete on context as well as on widget itself, deleteLater etc.
To reproduce: Create project with MainWindow and TabWidget inside and some trigger event (PushButton or action etc.)
And implement two methods.
void Project::on_actionOpen_triggered() { ui->tabWidget->addTab(new QOpenGLWidget, "Tab"); }
void Project::on_tabWidget_tabCloseRequested(int tabId)
{
QOpenGLWidget *vw = static_cast<QOpenGLWidget*>(ui->tabWidget->widget(tabId));
vw->deleteLater();
}
In TaskManager (and Visual Studio Memory Usage) the memory used will be only higher with minimal deallocations happening.