From fffee707b90bf33bec83f6b15b79de62f87f724b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 22 Aug 2009 20:33:57 +0000 Subject: [PATCH] 2009-08-22 22:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbqt_slots.cpp ! Fixed memorys leak in HbDbfModel::rowCount() and HbDbfModel::columnCount(). It was shown as "unreachable code" warning. --- harbour/ChangeLog | 5 +++++ harbour/contrib/hbqt/hbqt_slots.cpp | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c9331ae78a..bd26ec6003 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-22 22:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/hbqt_slots.cpp + ! Fixed memorys leak in HbDbfModel::rowCount() and HbDbfModel::columnCount(). + It was shown as "unreachable code" warning. + 2009-08-22 22:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * bin/hb-mkimp.bat ! Fixed warning LNK4093 in msvc lib command. diff --git a/harbour/contrib/hbqt/hbqt_slots.cpp b/harbour/contrib/hbqt/hbqt_slots.cpp index c643216547..78074a5b26 100644 --- a/harbour/contrib/hbqt/hbqt_slots.cpp +++ b/harbour/contrib/hbqt/hbqt_slots.cpp @@ -2017,20 +2017,26 @@ int HbDbfModel::rowCount( const QModelIndex & /*parent = QModelIndex()*/ ) const { PHB_ITEM p0 = hb_itemPutNI( NULL, HBQT_BRW_ROWCOUNT ); PHB_ITEM ret = hb_vmEvalBlockV( block, 1, p0 ); - hb_itemRelease( p0 ); - return hb_itemGetNI( ret ); + int result = hb_itemGetNI( ret ); + + hb_itemRelease( p0 ); hb_itemRelease( ret ); + + return result; } int HbDbfModel::columnCount( const QModelIndex & /*parent = QModelIndex()*/ ) const { PHB_ITEM p0 = hb_itemPutNI( NULL, HBQT_BRW_COLCOUNT ); PHB_ITEM ret = hb_vmEvalBlockV( block, 1, p0 ); - hb_itemRelease( p0 ); - return hb_itemGetNI( ret ); + int result = hb_itemGetNI( ret ); + + hb_itemRelease( p0 ); hb_itemRelease( ret ); + + return result; } QModelIndex HbDbfModel::index( int row, int column, const QModelIndex & parent ) const