Re-enabled wait_for_thread() (in place of kill_thread()) inside

TermParse's destructor. PtyReader() was hanging on read(), since the 
fd was never closed. Now we do that in ~TermWindow() (for now, we might 
want to move some stuff around). Moved there the cleanup code too (from 
TermWindow::Quit()). Use B_QUIT_ON_WINDOW_CLOSE flag instead of sending 
a message to be_app in Quit().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20335 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2007-03-05 14:59:37 +00:00
parent ff2184e07d
commit 96d6092ef6
3 changed files with 20 additions and 22 deletions
+2 -2
View File
@@ -148,10 +148,10 @@ TermApp::AboutRequested()
"\tupdated by Kian Duffy and others\n\n"
"\tCopyright " B_UTF8_COPYRIGHT "2003-2005, Haiku.\n", "Ok");
BTextView *view = alert->TextView();
BFont font;
view->SetStylable(true);
BFont font;
view->GetFont(&font);
font.SetSize(18);
font.SetFace(B_BOLD_FACE);
+2 -5
View File
@@ -78,11 +78,8 @@ TermParse::~TermParse()
delete_sem(fReaderLocker);
status_t dummy;
kill_thread(fParseThread);
kill_thread(fReaderThread);
//wait_for_thread(fReaderThread, &dummy);
//wait_for_thread(fParseThread, &dummy);
//
wait_for_thread(fReaderThread, &dummy);
wait_for_thread(fParseThread, &dummy);
}
+16 -15
View File
@@ -59,7 +59,7 @@ void SetCoding(int);
TermWindow::TermWindow(BRect frame, const char* title, int fd)
: BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE),
: BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE|B_QUIT_ON_WINDOW_CLOSE),
fPfd(fd)
{
InitWindow();
@@ -72,6 +72,17 @@ TermWindow::TermWindow(BRect frame, const char* title, int fd)
TermWindow::~TermWindow()
{
close(fPfd);
delete fTermParse;
delete fCodeConv;
if (fPrefWindow)
fPrefWindow->PostMessage(B_QUIT_REQUESTED);
if (fFindPanel && fFindPanel->Lock()) {
fFindPanel->Quit();
fFindPanel = NULL;
}
delete fWindowUpdate;
}
@@ -603,27 +614,17 @@ TermWindow::WindowActivated (bool )
void
TermWindow::Quit()
{
delete fTermParse;
delete fCodeConv;
if (fPrefWindow)
fPrefWindow->PostMessage(B_QUIT_REQUESTED);
if (fFindPanel && fFindPanel->Lock()) {
fFindPanel->Quit();
fFindPanel = NULL;
}
be_app->PostMessage(B_QUIT_REQUESTED, be_app);
BWindow::Quit ();
BWindow::Quit();
}
bool
TermWindow::QuitRequested(void)
{
return true;
return BWindow::QuitRequested();
}
////////////////////////////////////////////////////////////////////////////
// int GetTimeZone (void)
// Get Machine Timezone.