CameraView: use unique_ptr for CameraView::program (#23096)

pull/22937/head
Dean Lee 3 years ago committed by GitHub
parent c8356d3b8f
commit 8c6242888c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/ui/qt/widgets/cameraview.cc
  2. 2
      selfdrive/ui/qt/widgets/cameraview.h

@ -113,7 +113,7 @@ CameraViewWidget::~CameraViewWidget() {
void CameraViewWidget::initializeGL() {
initializeOpenGLFunctions();
program = new QOpenGLShaderProgram(context());
program = std::make_unique<QOpenGLShaderProgram>(context());
bool ret = program->addShaderFromSourceCode(QOpenGLShader::Vertex, frame_vertex_shader);
assert(ret);
ret = program->addShaderFromSourceCode(QOpenGLShader::Fragment, frame_fragment_shader);

@ -40,7 +40,7 @@ protected:
GLuint frame_vao, frame_vbo, frame_ibo;
mat4 frame_mat;
std::unique_ptr<EGLImageTexture> texture[UI_BUF_COUNT];
QOpenGLShaderProgram *program;
std::unique_ptr<QOpenGLShaderProgram> program;
QColor bg = QColor("#000000");
std::string stream_name;

Loading…
Cancel
Save