[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kdevelop/3.4/languages/cpp
From:       Jens Dagerbo <jens.dagerbo () swipnet ! se>
Date:       2006-10-18 20:32:50
Message-ID: 1161203570.269316.9514.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 596897 by dagerbo:

avoid hanging kdevelop on close by avoiding to setup the driver when the project \
closes (zwabel, please review). also, check that the _jd parsejob pointer isn't 0. \
for some reason this happens, although it isn't abvious from the code how it can.

 M  +8 -1      cppsupportpart.cpp  
 M  +1 -0      cppsupportpart.h  


--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.cpp #596896:596897
@@ -170,7 +170,7 @@
 CppSupportPart::CppSupportPart( QObject *parent, const char *name, const QStringList \
&args )  : KDevLanguageSupport( CppSupportFactory::info(), parent, name ? name : \
"KDevCppSupport" ),  m_activeDocument( 0 ), m_activeView( 0 ), m_activeSelection( 0 \
                ), m_activeEditor( 0 ),
-	m_activeViewCursor( 0 ), m_projectClosed( true ), m_valid( false ), _jd(0), \
m_isTyping( false ), m_hadErrors( false ) +	m_activeViewCursor( 0 ), m_projectClosed( \
true ), m_projectClosing( false ), m_valid( false ), _jd(0), m_isTyping( false ), \
m_hadErrors( false )  {
 	setInstance( CppSupportFactory::instance() );
 	
@@ -502,6 +502,8 @@
 {
 	kdDebug( 9007 ) << "projectClosed( )" << endl;
 	
+	m_projectClosing = true;
+	
 	QStringList enabledPCSs;
 	QValueList<Catalog*> catalogs = codeRepository() ->registeredCatalogs();
 	for ( QValueList<Catalog*>::Iterator it = catalogs.begin(); it != catalogs.end(); \
++it ) @@ -531,6 +533,7 @@
 	m_fileParsedEmitWaiting.clear();
 	m_pCompletion = 0;
 	m_projectClosed = true;
+	m_projectClosing = false;
 }
 
 
@@ -1308,6 +1311,8 @@
 	// When the project is closed, the language support plugin is destroyed
 	// and as a consequence, the timer job signal never arrives at this method
 
+	Q_ASSERT( _jd );
+	if ( !_jd ) return; // how can this possibly happen?!
 
 	if ( _jd->cycle == 0 && !m_projectClosed && _jd->it != _jd->files.end() )
 	{
@@ -1820,6 +1825,8 @@
 
 void CppSupportPart::codeCompletionConfigStored( )
 {
+	if ( m_projectClosing ) return;
+	
 	m_backgroundParser->updateParserConfiguration();
 	KDevDriver* d = dynamic_cast<KDevDriver*>( m_driver );
 	if( d ) d->setup();
--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.h #596896:596897
@@ -319,6 +319,7 @@
 
 	QWaitCondition m_eventConsumed;
 	bool m_projectClosed;
+	bool m_projectClosing;
 
 	QMap<QString, QDateTime> m_timestamp;
 	bool m_valid;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic