diff --git a/harbour/ChangeLog b/harbour/ChangeLog index da9eface6b..0f0f402cd5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ + +2012-06-28 12:30 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbpfiledialog.prg + ! Fix: to prev fix. I must test all scenarios before committing!!! + 2012-06-28 12:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbpfiledialog.prg ! Fixed: memory leak. Please read previously documented here diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index 5a897b4f6e..1bdf450d5f 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -213,7 +213,7 @@ STATIC FUNCTION Xbp_ArrayToFileFilter( aFilter ) METHOD XbpFileDialog:open( cDefaultFile, lCenter, lAllowMultiple, lCreateNewFiles ) LOCAL cFiles := NIL - LOCAL i, oList, nResult, cPath, cFile, cExt, qFocus + LOCAL i, oList, nResult, cPath, cFile, cExt, qFocus, xRes HB_SYMBOL_UNUSED( lCreateNewFiles ) @@ -269,18 +269,22 @@ METHOD XbpFileDialog:open( cDefaultFile, lCenter, lAllowMultiple, lCreateNewFile ::connect() nResult := ::oWidget:exec() ::disconnect() - ::oWidget:setParent( QWidget() ) IF hb_isObject( qFocus ) qFocus:setFocus( 0 ) ENDIF - RETURN IIF( nResult == QDialog_Accepted, ::extractFileNames( lAllowMultiple ), NIL ) + xRes := iif( nResult == QDialog_Accepted, ::extractFileNames( lAllowMultiple ), NIL ) + + // Just TO destroy it + ::oWidget:setParent( QWidget() ) + + RETURN xRes /*----------------------------------------------------------------------*/ METHOD XbpFileDialog:saveAs( cDefaultFile, lFileList, lCenter ) - LOCAL nResult, i, oList, qFocus + LOCAL nResult, i, oList, qFocus, xRes DEFAULT lFileList TO .T. @@ -324,13 +328,17 @@ METHOD XbpFileDialog:saveAs( cDefaultFile, lFileList, lCenter ) ::connect() nResult := ::oWidget:exec() ::disconnect() - ::oWidget:setParent( QWidget() ) IF hb_isObject( qFocus ) qFocus:setFocus( 0 ) ENDIF - RETURN IIF( nResult == QDialog_Accepted, ::extractFileNames(), NIL ) + xRes := iif( nResult == QDialog_Accepted, ::extractFileNames(), NIL ) + + // Just TO destroy it AND release memory + ::oWidget:setParent( QWidget() ) + + RETURN xRes /*----------------------------------------------------------------------*/