From 3b4cc84f91738ff9e5bbb5e1023167fb582d397f Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 26 Jan 2012 20:44:50 +0000 Subject: [PATCH] 2012-01-26 12:37 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idebrowse.prg * contrib/hbide/idechangelog.prg * contrib/hbide/idedocks.prg * contrib/hbide/idedocwriter.prg * contrib/hbide/ideedit.prg * contrib/hbide/ideeditor.prg * contrib/hbide/idefindreplace.prg * contrib/hbide/ideformat.prg * contrib/hbide/idefunctions.prg * contrib/hbide/ideharbourhelp.prg * contrib/hbide/idehome.prg * contrib/hbide/idemain.prg * contrib/hbide/ideobject.prg * contrib/hbide/idesaveload.prg * contrib/hbide/ideshortcuts.prg * contrib/hbide/ideskeletons.prg * contrib/hbide/idethemes.prg * contrib/hbide/idetools.prg * Fixed: (Hopefully) hbIDE crash at exit. This might happen at certain situations when a slot is executed while object has already been destroyed by its parent. The problem report was furnished by Antonio Linares, thanks. --- harbour/ChangeLog | 25 ++++++++++++++ harbour/contrib/hbide/idebrowse.prg | 4 +++ harbour/contrib/hbide/idechangelog.prg | 4 +++ harbour/contrib/hbide/idedocks.prg | 4 +++ harbour/contrib/hbide/idedocwriter.prg | 4 +++ harbour/contrib/hbide/ideedit.prg | 4 +++ harbour/contrib/hbide/ideeditor.prg | 8 +++++ harbour/contrib/hbide/idefindreplace.prg | 42 +++++------------------- harbour/contrib/hbide/ideformat.prg | 4 +++ harbour/contrib/hbide/idefunctions.prg | 4 +++ harbour/contrib/hbide/ideharbourhelp.prg | 4 +++ harbour/contrib/hbide/idehome.prg | 4 +++ harbour/contrib/hbide/idemain.prg | 3 ++ harbour/contrib/hbide/ideobject.prg | 1 + harbour/contrib/hbide/idesaveload.prg | 4 +++ harbour/contrib/hbide/ideshortcuts.prg | 4 +++ harbour/contrib/hbide/ideskeletons.prg | 4 +++ harbour/contrib/hbide/idethemes.prg | 4 +++ harbour/contrib/hbide/idetools.prg | 4 +++ 19 files changed, 102 insertions(+), 33 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f277ec308d..f7e9446112 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,31 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-26 12:37 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/idebrowse.prg + * contrib/hbide/idechangelog.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/idedocwriter.prg + * contrib/hbide/ideedit.prg + * contrib/hbide/ideeditor.prg + * contrib/hbide/idefindreplace.prg + * contrib/hbide/ideformat.prg + * contrib/hbide/idefunctions.prg + * contrib/hbide/ideharbourhelp.prg + * contrib/hbide/idehome.prg + * contrib/hbide/idemain.prg + * contrib/hbide/ideobject.prg + * contrib/hbide/idesaveload.prg + * contrib/hbide/ideshortcuts.prg + * contrib/hbide/ideskeletons.prg + * contrib/hbide/idethemes.prg + * contrib/hbide/idetools.prg + * Fixed: (Hopefully) hbIDE crash at exit. + This might happen at certain situations when a slot + is executed while object has already been destroyed + by its parent. + The problem report was furnished by Antonio Linares, thanks. + 2012-01-26 10:14 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbqt/hbqt_common.hbc ! untested patch to switch static supc++ to dynamic stdc++ diff --git a/harbour/contrib/hbide/idebrowse.prg b/harbour/contrib/hbide/idebrowse.prg index d57db4b329..c817998538 100644 --- a/harbour/contrib/hbide/idebrowse.prg +++ b/harbour/contrib/hbide/idebrowse.prg @@ -567,6 +567,10 @@ METHOD IdeBrowseManager:execEvent( cEvent, p, p1 ) HB_SYMBOL_UNUSED( p ) HB_SYMBOL_UNUSED( p1 ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "dockDbu_dragEnterEvent" p:acceptProposedAction() diff --git a/harbour/contrib/hbide/idechangelog.prg b/harbour/contrib/hbide/idechangelog.prg index d28447865b..81fcec6940 100644 --- a/harbour/contrib/hbide/idechangelog.prg +++ b/harbour/contrib/hbide/idechangelog.prg @@ -231,6 +231,10 @@ METHOD IdeChangeLog:execEvent( cEvent, p ) HB_SYMBOL_UNUSED( p ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "buttonTitle_clicked" diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 36bd8e7bd1..66f7117621 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -560,6 +560,10 @@ METHOD IdeDocks:buildSystemTray() METHOD IdeDocks:execEvent( cEvent, p, p1 ) LOCAL qEvent, qMime, qList, qUrl, i, n, oEdit, aMenu + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "dockCuiEd_visibilityChanged" IF p; ::oCUI:show(); ENDIF diff --git a/harbour/contrib/hbide/idedocwriter.prg b/harbour/contrib/hbide/idedocwriter.prg index b00bded102..0646b15b29 100644 --- a/harbour/contrib/hbide/idedocwriter.prg +++ b/harbour/contrib/hbide/idedocwriter.prg @@ -303,6 +303,10 @@ METHOD IdeDocWriter:setParameters() METHOD IdeDocWriter:execEvent( nMode, p ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH nMode CASE buttonArgs_clicked IF p diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index 145118c010..c59d894b25 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -442,6 +442,10 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) HB_SYMBOL_UNUSED( p1 ) + IF ::lQuitting + RETURN Self + ENDIF + qEdit := oEdit:qEdit qCursor := qEdit:textCursor() oEdit:nCurLineNo := qCursor:blockNumber() diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 026e8f73cc..f58c9f4561 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -421,6 +421,10 @@ METHOD IdeEditsManager:addSourceInTree( cSourceFile, cView ) METHOD IdeEditsManager:execEvent( cEvent, p ) LOCAL oEdit + IF ::lQuitting + RETURN Self + ENDIF + DO CASE CASE cEvent == "qFldsCompleter_activated" IF !empty( oEdit := ::getEditObjectCurrent() ) @@ -1683,6 +1687,10 @@ METHOD IdeEditor:execEvent( cEvent, p ) p := p + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "qTimeSave_timeout" diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index dd14bc46f2..470e3a18d6 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -166,6 +166,9 @@ METHOD IdeUpDown:execEvent( cEvent, p ) LOCAL cText, oEdit HB_SYMBOL_UNUSED( p ) + IF ::lQuitting + RETURN Self + ENDIF IF !empty( oEdit := ::oEM:getEditObjectCurrent() ) cText := oEdit:getSelectedText() @@ -878,6 +881,10 @@ METHOD IdeFindInFiles:buildUI() METHOD IdeFindInFiles:execEvent( cEvent, p ) LOCAL cPath, qLineEdit, qCursor, cSource, v, nInfo + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "buttonClose" @@ -968,10 +975,7 @@ METHOD IdeFindInFiles:execEvent( cEvent, p ) METHOD IdeFindInFiles:replaceAll() LOCAL nL, nB, qCursor, aFind LOCAL cSource := "" -#if 0 - LOCAL isOpen := .f. - LOCAL isModified := .f. -#endif + IF empty( ::cReplWith := ::oUI:q_comboRepl:currentText() ) RETURN Self ENDIF @@ -984,24 +988,6 @@ METHOD IdeFindInFiles:replaceAll() FOR EACH aFind IN ::aInfo IF aFind[ 1 ] == -2 IF ! ( cSource == aFind[ 2 ] ) -#if 0 - IF ! empty( cSource ) - IF ! isOpen - ::oSM:closeSource( , .f., .f., .f. ) - ELSE - IF ! isModified - ::oSM:saveSource() - ENDIF - ENDIF - ENDIF - cSource := aFind[ 2 ] - IF ( isOpen := ::oEM:isOpen( cSource ) ) - ::oEM:setSourceVisible( cSource ) - isModified := ::oEM:getEditorCurrent():qDocument:isModified() - ELSE - ::oSM:editSource( cSource, 0, 0, 0, NIL, NIL, .f., .t. ) - ENDIF -#endif cSource := aFind[ 2 ] ::oSM:editSource( cSource, 0, 0, 0, NIL, "Main", .f., .t. ) ENDIF @@ -1024,17 +1010,7 @@ METHOD IdeFindInFiles:replaceAll() qCursor:endEditBlock() ENDIF NEXT -#if 0 - IF ! empty( cSource ) - IF ! isOpen - ::oSM:closeSource( , .f., .f., .f. ) - ELSE - IF ! isModified - ::oSM:saveSource() - ENDIF - ENDIF - ENDIF -#endif + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/ideformat.prg b/harbour/contrib/hbide/ideformat.prg index 1c5d464f12..4ff419710b 100644 --- a/harbour/contrib/hbide/ideformat.prg +++ b/harbour/contrib/hbide/ideformat.prg @@ -163,6 +163,10 @@ METHOD IdeFormat:execEvent( cEvent, p ) HB_SYMBOL_UNUSED( p ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "checkSelOnly_changed" diff --git a/harbour/contrib/hbide/idefunctions.prg b/harbour/contrib/hbide/idefunctions.prg index 45a5cbfe7b..b919a45260 100644 --- a/harbour/contrib/hbide/idefunctions.prg +++ b/harbour/contrib/hbide/idefunctions.prg @@ -151,6 +151,10 @@ METHOD IdeFunctions:create( oIde ) METHOD IdeFunctions:execEvent( nMode, p ) LOCAL n, nLen + IF ::lQuitting + RETURN Self + ENDIF + DO CASE CASE nMode == "editFunc_textChanged" p := upper( p ) diff --git a/harbour/contrib/hbide/ideharbourhelp.prg b/harbour/contrib/hbide/ideharbourhelp.prg index b808dec338..da2894464d 100644 --- a/harbour/contrib/hbide/ideharbourhelp.prg +++ b/harbour/contrib/hbide/ideharbourhelp.prg @@ -497,6 +497,10 @@ METHOD IdeHarbourHelp:execEvent( nMode, p, p1 ) HB_SYMBOL_UNUSED( p1 ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH nMode CASE "buttonInstall_clicked" diff --git a/harbour/contrib/hbide/idehome.prg b/harbour/contrib/hbide/idehome.prg index 6690f26265..d0c5c80cd4 100644 --- a/harbour/contrib/hbide/idehome.prg +++ b/harbour/contrib/hbide/idehome.prg @@ -220,6 +220,10 @@ METHOD IdeHome:destroy() METHOD IdeHome:execEvent( nMode, p ) LOCAL cAct, cText, cExt + IF ::lQuitting + RETURN Self + ENDIF + DO CASE CASE nMode == "tabWidget_currentChanged" IF p == 0 diff --git a/harbour/contrib/hbide/idemain.prg b/harbour/contrib/hbide/idemain.prg index 3d872a575e..7a5ce9ff17 100644 --- a/harbour/contrib/hbide/idemain.prg +++ b/harbour/contrib/hbide/idemain.prg @@ -333,6 +333,7 @@ CLASS HbIde DATA oSysMenu DATA lSortedFuncList INIT .t. + DATA lQuitting INIT .f. METHOD new( aParams ) METHOD create( aParams ) @@ -756,12 +757,14 @@ METHOD HbIde:create( aParams ) nEvent := AppEvent( @mp1, @mp2, @oXbp ) IF nEvent == xbeP_Quit + ::lQuitting := .t. ::oINI:save() EXIT ENDIF IF nEvent == xbeP_Close .AND. oXbp == ::oDlg IF hbide_setClose() + ::lQuitting := .t. ::oINI:save() ::oSM:closeAllSources( .f. /* can not cancel */ ) EXIT diff --git a/harbour/contrib/hbide/ideobject.prg b/harbour/contrib/hbide/ideobject.prg index 1d522aec36..b49ca98911 100644 --- a/harbour/contrib/hbide/ideobject.prg +++ b/harbour/contrib/hbide/ideobject.prg @@ -216,6 +216,7 @@ CLASS IdeObject ACCESS lCurrentLineHighlightEnabled INLINE ::oIde:lCurrentLineHighlightEnabled ACCESS aMarkTBtns INLINE ::oIde:aMarkTBtns + ACCESS lQuitting INLINE ::oIde:lQuitting DATA aSlots INIT {} DATA aEvents INIT {} diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 2909e59eaa..93e66dd0fb 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -1566,6 +1566,10 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 ) HB_SYMBOL_UNUSED( p1 ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "buttonSelFont_clicked" diff --git a/harbour/contrib/hbide/ideshortcuts.prg b/harbour/contrib/hbide/ideshortcuts.prg index d91e93258d..cb07aae004 100644 --- a/harbour/contrib/hbide/ideshortcuts.prg +++ b/harbour/contrib/hbide/ideshortcuts.prg @@ -310,6 +310,10 @@ METHOD IdeShortcuts:show() METHOD IdeShortcuts:execEvent( nMode, p ) LOCAL nRow, cMethod, cFile, cPath, cTemp, cExt, a_ + IF ::lQuitting + RETURN Self + ENDIF + SWITCH nMode CASE 21000 diff --git a/harbour/contrib/hbide/ideskeletons.prg b/harbour/contrib/hbide/ideskeletons.prg index f6b1fd9e9c..bff7b68f20 100644 --- a/harbour/contrib/hbide/ideskeletons.prg +++ b/harbour/contrib/hbide/ideskeletons.prg @@ -173,6 +173,10 @@ METHOD IdeSkeletons:execEvent( cEvent, p ) HB_SYMBOL_UNUSED( p ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "buttonNew_clicked" diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index 757f85f007..60e0e8420c 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -257,6 +257,10 @@ METHOD IdeThemes:execEvent( cEvent, p ) HB_SYMBOL_UNUSED( p ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cEvent CASE "listItems_currentRowChanged" ::nCurItem := p+1 diff --git a/harbour/contrib/hbide/idetools.prg b/harbour/contrib/hbide/idetools.prg index 5e446684e7..0ce53dcc0b 100644 --- a/harbour/contrib/hbide/idetools.prg +++ b/harbour/contrib/hbide/idetools.prg @@ -322,6 +322,10 @@ METHOD IdeToolsManager:execEvent( cMode, p ) HB_SYMBOL_UNUSED( p ) + IF ::lQuitting + RETURN Self + ENDIF + SWITCH cMode CASE "checkToolActive_stateChanged" nRow := ::oUI:q_listToolbars:currentRow()