2012-07-02 22:19 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtcore/hbqt_bind.cpp
    % Optimized: hbqt_bindDestroyQtObject().
       This might resolve double-freeing of objects on Linux.

  * contrib/hbqt/tests/demoqt.prg
    + Enabled: Build_Tree() function.
This commit is contained in:
Pritpal Bedi
2012-07-03 05:24:24 +00:00
parent bfee8cfc23
commit ea5dc31644
3 changed files with 16 additions and 28 deletions

View File

@@ -16,6 +16,14 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-07-02 22:19 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtcore/hbqt_bind.cpp
% Optimized: hbqt_bindDestroyQtObject().
This might resolve double-freeing of objects on Linux.
* contrib/hbqt/tests/demoqt.prg
+ Enabled: Build_Tree() function.
2012-07-02 16:01 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth
! Fixed: regression as per prev commit.

View File

@@ -607,34 +607,18 @@ void hbqt_bindDestroyQtObject( void * qtObject, QObject * qObject )
{
if( qtObject )
{
qObject->disconnect();
PHBQT_BIND bind = hbqt_bindGetBindByQtObject( qtObject );
if( bind != NULL )
{
if( bind->pDelFunc != NULL )
{
HB_TRACE( HB_TR_DEBUG, ( "............QT_DESTROYS( %i, %i, %p, %s )..............", bind->iThreadId, bind->iFlags, bind->qtObject, bind->szClassName ) );
HB_TRACE( HB_TR_DEBUG, ( "............QT_DESTROYS( %i, %i, %p, %s )..............", bind->iThreadId, bind->iFlags, bind->qtObject, bind->szClassName ) );
int iFlags = bind->iFlags;
PHBQT_DEL_FUNC pDelFunc = bind->pDelFunc;
qObject->disconnect();
if( bind->fEventFilterInstalled )
{
qObject->removeEventFilter( hbqt_bindGetThreadData()->pReceiverEvents );
}
hbqt_bindRemoveBind( bind );
pDelFunc( qtObject, iFlags ); /* Though this is not needed as Qt will delete the object,
* but may be because Harbour uses is own memory manager,
* it seems necessary to reclaim the memory.
*/
}
else
if( bind->fEventFilterInstalled )
{
hbqt_bindRemoveBind( bind ); /* Conceptually it must not reach here, but... It is Qt */
qObject->removeEventFilter( hbqt_bindGetThreadData()->pReceiverEvents );
}
}
else
{
qObject->disconnect();
hbqt_bindRemoveBind( bind );
}
}
}

View File

@@ -349,11 +349,7 @@ STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize )
RETURN { aCtrls }
/*----------------------------------------------------------------------*/
#if 1
STATIC FUNCTION Build_TreeView( oWnd )
HB_SYMBOL_UNUSED( oWnd )
RETURN NIL
#else
STATIC FUNCTION Build_TreeView( oWnd )
LOCAL oDirModel
LOCAL oTV
@@ -369,7 +365,7 @@ STATIC FUNCTION Build_TreeView( oWnd )
OTV:show()
RETURN NIL
#endif
/*----------------------------------------------------------------------*/
STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize )