X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=video_widget.cpp;h=1f3534f117cdf425c6fc1ba048706f82580f4921;hb=9a57e555972a2acc5cbd60c17154c602c9a883c0;hp=0bd910ce29f826e86e62629ad609158ca72e09a1;hpb=a41db5d218a10c7863952d98eea1daab9f8d0171;p=pkanalytics diff --git a/video_widget.cpp b/video_widget.cpp index 0bd910c..1f3534f 100644 --- a/video_widget.cpp +++ b/video_widget.cpp @@ -240,6 +240,7 @@ VideoWidget::VideoWidget(QWidget *parent) : QWidget(parent), video_window(new VideoWindow(this)) { setLayout(new QHBoxLayout); + layout()->setContentsMargins(QMargins()); layout()->addWidget(QWidget::createWindowContainer(video_window)); // ... @@ -249,6 +250,16 @@ VideoWidget::VideoWidget(QWidget *parent) connect(video_window, &VideoWindow::mouse_moved, this, &VideoWidget::mouseMoveEvent); } +VideoWidget::~VideoWidget() +{ + stop(); + + // Qt will delete video_window for us after we're gone, + // so make sure its destructor does not try to mess with + // our freelist. The actual freelist frames will leak. + video_window->set_current_frame(nullptr); +} + GLuint compile_shader(const string &shader_src, GLenum type) { GLuint obj = glCreateShader(type);