Mercurial > retraceit
comparison src/pngplayer.cpp @ 103:43af5fccf61e
Fix possible double free on exit
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 18 Nov 2016 12:47:21 +0100 |
parents | 73e6b6b12412 |
children |
comparison
equal
deleted
inserted
replaced
102:568d92c03941 | 103:43af5fccf61e |
---|---|
223 mPNGLabel->showMaximized(); | 223 mPNGLabel->showMaximized(); |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 void PNGPlayer::close() { | 227 void PNGPlayer::close() { |
228 QVBoxLayout *baseLayout = qobject_cast<QVBoxLayout*>(layout()); | 228 QWidget::close(); |
229 if (!baseLayout) { | 229 } |
230 qWarning() << "Wrong layout!"; | |
231 return; | |
232 } | |
233 if (baseLayout->indexOf(mPNGLabel) == -1) { | |
234 delete mPNGLabel; | |
235 } | |
236 } |