<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=justify><FONT face=Arial size=2>i found a problem in the
<EM><STRONG>class</STRONG></EM> <STRONG><EM>BackgroundParser </EM></STRONG>(file
backgroundparser.cpp). If the function <STRONG><EM>BackgroundParser::close()
</EM></STRONG>is called from the destructor of the </FONT><FONT face=Arial><FONT
size=2><STRONG><EM>class CppSupportPart</EM></STRONG>, it may happen that the
QT-thread causes a segmentation fault. This is possible because the function
call </FONT></FONT><FONT face=Arial><FONT
size=2><STRONG><EM>m_backgroundParser-></EM></STRONG><STRONG><EM>wait()</EM></STRONG>
returns before the QT-thread terminates. In that case the QT-thread uses
<STRONG><EM>BackgroundParser </EM></STRONG>object specific data that are no
longer available (see <STRONG><EM>BackgroundParser::run()</EM></STRONG>). A
solution for that problem is to change the following functions in
<STRONG><EM>languages/cpp/cppsupportpart.cpp</EM></STRONG> </FONT></FONT></DIV>
<DIV><STRONG><EM><FONT face=Arial size=2></FONT></EM></STRONG> </DIV>
<DIV dir=ltr><FONT face=Arial
size=2>CppSupportPart::~CppSupportPart()</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>{</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2> if
(project())</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>
projectClosed();</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2> delete( m_driver
);</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2> m_driver =
0;</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2> if(
m_backgroundParser )</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
{</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
m_backgroundParser->close();</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff
size=2> </FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
// not really a wait function ??? ;-}}</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
//m_backgroundParser->wait();</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff
size=2> </FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff
size=2> delete
m_backgroundParser;</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
m_backgroundParser = 0;</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
}</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>...</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>}</FONT></DIV>
<P><FONT face=Arial><FONT size=2>and in
<STRONG><EM>languages/cpp/backgroundparser.cpp</EM></STRONG></FONT></FONT></P>
<DIV dir=ltr><FONT face=Arial size=2>void BackgroundParser::close()</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>{</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2> QMutexLocker locker(
&m_mutex );</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2> m_close =
true;</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>
m_canParse.wakeAll();</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2> // safer
termination</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2> while
(running())</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#0000ff size=2>
sleep(1);</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>}</FONT></DIV>
<P dir=ltr><FONT face=Arial size=2>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.</FONT></P>
<P dir=ltr><FONT face=Arial size=2>It would be great if i get r/w - access to
the cvs database to remove the problem.</FONT></P>
<P dir=ltr><FONT face=Arial size=2>Best regards</FONT></P></BODY></HTML>