Kdevelop termination problem unde suse 9.0 amd64 linux edition

Jens Dagerbo jens.dagerbo at swipnet.se
Wed Mar 3 20:15:06 UTC 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Thanks for the patch. It has been committed to CVS. :)

jd

On Friday 27 February 2004 14:44, Vodafone wrote:
> Dear all,
>
> i found a problem in the class BackgroundParser (file
> backgroundparser.cpp). If the function BackgroundParser::close() is called
> from the destructor of the class CppSupportPart, it may happen that the
> QT-thread causes a segmentation fault. This is possible because the
> function call m_backgroundParser->wait() returns before the QT-thread
> terminates. In that case the QT-thread uses BackgroundParser object
> specific data that are no longer available (see BackgroundParser::run()). A
> solution for that problem is to change the following functions in
> languages/cpp/cppsupportpart.cpp
>
> CppSupportPart::~CppSupportPart()
> {
>     if (project())
>         projectClosed();
>
>     delete( m_driver );
>     m_driver = 0;
>     if( m_backgroundParser )
>     {
>         m_backgroundParser->close();
>
>         // not really a wait function ??? ;-}}
>         //m_backgroundParser->wait();
>
>         delete m_backgroundParser;
>         m_backgroundParser = 0;
>     }
> ...
> }
> and in languages/cpp/backgroundparser.cpp
>
> void BackgroundParser::close()
> {
>     QMutexLocker locker( &m_mutex );
>     m_close = true;
>     m_canParse.wakeAll();
>
>     // safer termination
>     while (running())
>         sleep(1);
> }
> This way guarantees that the thread can use the object data and terminates
> before the destructor is called. It works perfect on my 64 Bit linux
> (amd64) so i guess the QT - libraries may have a different behaviour on
> particular systems.
>
> It would be great if i get r/w - access to the cvs database to remove the
> problem.
>
> Best regards
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFARi6T6meJzsUuplQRArM1AJ9Tm/53A7tnMWPbLwVuP40cGLniagCgnXOE
3TCWqHPxVcodpHloBCm4grs=
=gdwI
-----END PGP SIGNATURE-----




More information about the KDevelop-devel mailing list