diff --git a/source/SubWindowHandle.cpp b/source/SubWindowHandle.cpp index 923879f..09e1996 100644 --- a/source/SubWindowHandle.cpp +++ b/source/SubWindowHandle.cpp @@ -47,6 +47,9 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : m_cScrollArea->setWidget( m_cViewArea ); m_cScrollArea->setWidgetResizable(true); + m_pCurrStream = new InputStream; + + m_pCurrFrameQImage = NULL; m_pcCurrentModule = NULL; m_cWindowName = QString( " " ); @@ -58,19 +61,22 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : SubWindowHandle::~SubWindowHandle() { delete m_cViewArea; - if( !m_pcCurrentModule ) - return; - m_pcCurrentModule->m_pcAction->setChecked( false ); - m_pcCurrentModule->destroy(); - m_pcCurrentModule = NULL; + delete m_cScrollArea; + delete m_pCurrStream; + if( m_pCurrFrameQImage ) + delete m_pCurrFrameQImage; + if( m_pcCurrentModule ) + { + m_pcCurrentModule->m_pcAction->setChecked( false ); + m_pcCurrentModule->destroy(); + m_pcCurrentModule = NULL; + } } bool SubWindowHandle::loadFile( const QString &fileName ) { ConfigureFormatDialog formatDialog( this ); - m_pCurrStream = new InputStream; - if( m_pCurrStream->needFormatDialog( fileName ) ) { if( formatDialog.exec() == QDialog::Rejected ) @@ -166,7 +172,7 @@ Void SubWindowHandle::refreshFrame() } else { - FrameToQImage( m_pCurrStream->getFrame( (PlaYUVerFrame*) NULL ) ); + FrameToQImage( m_pCurrStream->getFrame() ); } m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); } diff --git a/source/plaYUVerApp.cpp b/source/plaYUVerApp.cpp index 47f6ca5..fa6cf15 100644 --- a/source/plaYUVerApp.cpp +++ b/source/plaYUVerApp.cpp @@ -632,12 +632,12 @@ void plaYUVerApp::setActiveSubWindow( QWidget *window ) void plaYUVerApp::updatePixelValueStatusBar(const QPoint & pos, InputStream* stream) { - Pel luma, chromaU, chromaV; + Pel luma, chromaU = 0, chromaV = 0; Int iWidth, iHeight; Int posX = pos.x(), posY = pos.y(); QString strPixel; QString strStatus = QString("(%1,%2) ").arg(posX).arg(posY); - PlaYUVerFrame *curFrame = stream->getCurrentFrame(); + PlaYUVerFrame *curFrame = stream->getFrame(); iWidth = stream->getWidth(); iHeight = stream->getHeight(); @@ -645,8 +645,8 @@ void plaYUVerApp::updatePixelValueStatusBar(const QPoint & pos, InputStream* str if( (posX=0) && (posY=0) ) { luma = curFrame->getPixelValueFromYUV(pos, LUMA); - chromaU = curFrame->getPixelValueFromYUV(pos, CHROMA_U); - chromaV = curFrame->getPixelValueFromYUV(pos, CHROMA_V); + //chromaU = curFrame->getPixelValueFromYUV(pos, CHROMA_U); + //chromaV = curFrame->getPixelValueFromYUV(pos, CHROMA_V); strPixel = QString("Y: %1 U: %2 V: %3").arg(luma).arg(chromaU).arg(chromaV); } else