From e0bb144d5b6e72e237a45b064186835c069bf31a Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 20 Apr 2010 00:02:57 +0000 Subject: [PATCH] 2010-04-19 17:04 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbxbp/xbpfiledialog.prg * contrib/hbxbp/xbpfontdialog.prg % An important fix for ancilliary dialogs, i.e., file and font, to not be added as childrent to parent on :create(). This facilitate to destroy these dialogs after done with. * contrib/hbxbp/tests/demoxbp.prg ! Destroying XbpFileDialog() explicitly. Now memory is released proper. --- harbour/ChangeLog | 10 ++++++++++ harbour/contrib/hbxbp/tests/demoxbp.prg | 8 ++++++-- harbour/contrib/hbxbp/xbpfiledialog.prg | 1 - harbour/contrib/hbxbp/xbpfontdialog.prg | 1 - 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7023aa9ffc..22979d6e41 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-19 17:04 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbxbp/xbpfiledialog.prg + * contrib/hbxbp/xbpfontdialog.prg + % An important fix for ancilliary dialogs, i.e., file and font, + to not be added as childrent to parent on :create(). + This facilitate to destroy these dialogs after done with. + + * contrib/hbxbp/tests/demoxbp.prg + ! Destroying XbpFileDialog() explicitly. Now memory is released proper. + 2010-04-19 16:05 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbxbp/tests/demoxbp.prg ! Deleted no more existing debug calls. diff --git a/harbour/contrib/hbxbp/tests/demoxbp.prg b/harbour/contrib/hbxbp/tests/demoxbp.prg index 079141dad0..1d795225a1 100644 --- a/harbour/contrib/hbxbp/tests/demoxbp.prg +++ b/harbour/contrib/hbxbp/tests/demoxbp.prg @@ -1361,7 +1361,7 @@ FUNCTION Build_Bitmap( oWnd ) /*----------------------------------------------------------------------*/ FUNCTION GetAnImageFile( oWnd, cTitle ) - LOCAL oDlg, aFltr := {} + LOCAL oDlg, aFltr := {}, xRet DEFAULT cTitle TO "Select an Image" @@ -1380,7 +1380,11 @@ FUNCTION GetAnImageFile( oWnd, cTitle ) oDlg:fileFilters := aFltr oDlg:create() - RETURN oDlg:open( hb_DirBase(), , .f. ) + xRet := oDlg:open( hb_DirBase(), , .f. ) + + oDlg:destroy() + + RETURN xRet /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index 45079d18d6..2e15401987 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -125,7 +125,6 @@ METHOD XbpFileDialog:create( oParent, oOwner, aPos ) ::connect( ::pWidget, "filesSelected(QStringList)", {|p| ::exeBlock( 7, p ) } ) ::connect( ::pWidget, "filterSelected(QString)" , {|p| ::exeBlock( 8, p ) } ) - ::oParent:addChild( Self ) RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfontdialog.prg b/harbour/contrib/hbxbp/xbpfontdialog.prg index cad98ba35f..3b72179868 100644 --- a/harbour/contrib/hbxbp/xbpfontdialog.prg +++ b/harbour/contrib/hbxbp/xbpfontdialog.prg @@ -206,7 +206,6 @@ METHOD XbpFontDialog:create( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) ::connect( ::pwidget, "currentFontChanged(QFont)", {|p| ::exeBlock( 4, p ) } ) ::connect( ::pwidget, "fontSelected(QFont)" , {|p| ::exeBlock( 5, p ) } ) - ::oParent:addChild( Self ) RETURN Self /*----------------------------------------------------------------------*/