From 8b216d9620528a7bb879e12a2bf0e0cee21fdeba Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 14 Mar 2011 20:50:11 +0000 Subject: [PATCH] 2011-03-14 13:46 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqt_hbqevents.cpp ! Fixed: wrong event was being fired instead of relevant one. * contrib/hbqt/qtcore/hbqt_pointer.cpp ! Fixed: a memory leak. --- harbour/ChangeLog | 6 ++++++ harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp | 5 ++++- harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp | 10 +++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f40c9a7042..e36febb384 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-14 13:46 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtcore/hbqt_hbqevents.cpp + ! Fixed: wrong event was being fired instead of relevant one. + * contrib/hbqt/qtcore/hbqt_pointer.cpp + ! Fixed: a memory leak. + 2011-03-14 16:17 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbssl/x509.c + Enable feature which is fixed with newer (1.0.0) openssl diff --git a/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp b/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp index 403a5b4dac..0be0e4bcd8 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp @@ -87,7 +87,10 @@ void hbqt_events_register_createobj( QEvent::Type eventtype, QByteArray szCreate s_pEventAllocateCallback << pCallback; } else + { s_lstCreateObj[ iIndex ] = szCreateObj.toUpper(); + s_pEventAllocateCallback[ iIndex ] = pCallback; + } } void hbqt_events_unregister_createobj( QEvent::Type eventtype ) @@ -212,7 +215,7 @@ bool HBQEvents::eventFilter( QObject * object, QEvent * event ) int eventId = s_lstEvent.indexOf( eventtype ); if( eventId > -1 && hb_vmRequestReenter() ) { - PHBQT_EVENT_FUNC pCallback = s_pEventAllocateCallback.at( found - 1 ); + PHBQT_EVENT_FUNC pCallback = s_pEventAllocateCallback.at( eventId ); if( pCallback ) { PHB_ITEM pEvent = hbqt_create_objectGC( ( * pCallback )( event, false ), s_lstCreateObj.at( eventId ) ); diff --git a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp index 88c50fcda8..4eb001acc7 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp @@ -551,7 +551,7 @@ PHB_ITEM hbqt_create_object( void * pObject, const char * pszObjectName ) pItem = hb_itemPutPtr( NULL, pObject ); pRetVal = hb_itemNew( hb_stackReturnItem() ); hb_objSendMsg( pRetVal, "_PPTR", 1, pItem ); - hb_itemReturn( pRetVal ); + hb_itemReturnRelease( pRetVal ); hb_itemRelease( pItem ); return hb_stackReturnItem(); @@ -559,8 +559,7 @@ PHB_ITEM hbqt_create_object( void * pObject, const char * pszObjectName ) PHB_ITEM hbqt_create_objectGC( void * pObject, const char * pszObjectName ) { - PHB_ITEM pRetVal; - PHB_ITEM pItem; + PHB_ITEM pItem, pRetVal; HB_TRACE( HB_TR_DEBUG, ( "create_object_GC %s", pszObjectName ) ); @@ -568,10 +567,11 @@ PHB_ITEM hbqt_create_objectGC( void * pObject, const char * pszObjectName ) hb_vmPushNil(); hb_vmDo( 0 ); - pItem = hb_itemPutPtrGC( NULL, pObject ); pRetVal = hb_itemNew( hb_stackReturnItem() ); + + pItem = hb_itemPutPtrGC( NULL, pObject ); hb_objSendMsg( pRetVal, "_PPTR", 1, pItem ); - hb_itemReturn( pRetVal ); + hb_itemReturnRelease( pRetVal ); hb_itemRelease( pItem ); return hb_stackReturnItem();