From a059915b3ef6e93ce3965bf506a1aa83ccf4c5f2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 17 Jul 2011 09:39:06 +0000 Subject: [PATCH] 2011-07-17 11:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtgui/hbqt_init.cpp * contrib/hbqt/qtcore/hbqt_init.cpp ! moved s_PHB_ITEM_tobedeleted logic to HBQTCORE --- harbour/ChangeLog | 7 ++++++- harbour/contrib/hbqt/qtcore/hbqt_init.cpp | 19 +++++++++++++++++++ harbour/contrib/hbqt/qtgui/hbqt_init.cpp | 18 ------------------ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e7569f1782..e304d27749 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,11 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2011-07-17 11:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qtgui/hbqt_init.cpp + * contrib/hbqt/qtcore/hbqt_init.cpp + ! moved s_PHB_ITEM_tobedeleted logic to HBQTCORE + 2011-07-17 11:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtgui/hbqt_init.cpp * variables scopes * formatting - ; TOFIX: s_PHB_ITEM_tobedeleted logic to be moved to hbqtcore + ; TOFIX: s_PHB_ITEM_tobedeleted logic to be moved to hbqtcore [DONE] 2011-07-16 15:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/gtwvt/gtwvt.c diff --git a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp index 756ff517e0..d1f1397dd5 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp @@ -407,6 +407,8 @@ static void hbqt_registerCallbacks( void ) /*----------------------------------------------------------------------*/ +static QList s_PHB_ITEM_tobedeleted; + HB_FUNC( __HBQTCORE ) {;} static void hbqt_lib_init( void * cargo ) @@ -415,9 +417,26 @@ static void hbqt_lib_init( void * cargo ) hbqt_registerCallbacks(); } +void hbqt_addDeleteList( PHB_ITEM item ) +{ + HB_TRACE( HB_TR_DEBUG, ( "-------------------------hbqt_addDeleteList # %d", s_PHB_ITEM_tobedeleted.size() ) ); + s_PHB_ITEM_tobedeleted << item; +} + static void hbqt_lib_exit( void * cargo ) { HB_SYMBOL_UNUSED( cargo ); + + while( ! s_PHB_ITEM_tobedeleted.isEmpty() ) + { + int i = s_PHB_ITEM_tobedeleted.size() - 1; + if( s_PHB_ITEM_tobedeleted.at( i ) != NULL ) + { + void * ptr = ( void * ) s_PHB_ITEM_tobedeleted.at( i ); + s_PHB_ITEM_tobedeleted.removeAt( i ); + hb_itemRelease( ptr ); + } + } } HB_CALL_ON_STARTUP_BEGIN( _hbqtcore_init_ ) diff --git a/harbour/contrib/hbqt/qtgui/hbqt_init.cpp b/harbour/contrib/hbqt/qtgui/hbqt_init.cpp index 1370b07518..ba754b4745 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_init.cpp @@ -607,7 +607,6 @@ static void hbqt_registerCallbacks( void ) /*----------------------------------------------------------------------*/ static QApplication * s_app = NULL; -static QList s_PHB_ITEM_tobedeleted; HB_FUNC_EXTERN( __HBQTCORE ); @@ -625,12 +624,6 @@ QApplication * __hbqtgui_app( void ) return s_app; } -void hbqt_addDeleteList( PHB_ITEM item ) -{ - HB_TRACE( HB_TR_DEBUG, ( "-------------------------hbqt_addDeleteList # %d", s_PHB_ITEM_tobedeleted.size() ) ); - s_PHB_ITEM_tobedeleted << item; -} - static void hbqt_lib_init( void * cargo ) { static int s_argc; @@ -659,17 +652,6 @@ static void hbqt_lib_init( void * cargo ) static void hbqt_lib_exit( void * cargo ) { HB_SYMBOL_UNUSED( cargo ); - - while( ! s_PHB_ITEM_tobedeleted.isEmpty() ) - { - int i = s_PHB_ITEM_tobedeleted.size() - 1; - if( s_PHB_ITEM_tobedeleted.at( i ) != NULL ) - { - void * ptr = ( void * ) s_PHB_ITEM_tobedeleted.at( i ); - s_PHB_ITEM_tobedeleted.removeAt( i ); - hb_itemRelease( ptr ); - } - } }