Commit 8f1d27f0 authored by Tony Castley's avatar Tony Castley

Fixed code to close vout window, does not segfault anymore.

parent 3cb37141
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.51 2002/04/02 10:44:40 tcastley Exp $ * $Id: vout_beos.cpp,v 1.52 2002/04/10 10:08:06 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -174,13 +174,10 @@ VideoWindow::~VideoWindow() ...@@ -174,13 +174,10 @@ VideoWindow::~VideoWindow()
int32 result; int32 result;
teardownwindow = true; teardownwindow = true;
Lock();
view->ClearViewOverlay();
wait_for_thread(fDrawThreadID, &result); wait_for_thread(fDrawThreadID, &result);
delete overlaybitmap; if (overlaybitmap) delete overlaybitmap;
delete bitmap[0]; if (bitmap[0]) delete bitmap[0];
delete bitmap[1]; if (bitmap[1]) delete bitmap[1];
Quit();
} }
void VideoWindow::drawBuffer(int bufferIndex) void VideoWindow::drawBuffer(int bufferIndex)
...@@ -324,7 +321,7 @@ int VideoWindow::SelectDrawingMode(int width, int height) ...@@ -324,7 +321,7 @@ int VideoWindow::SelectDrawingMode(int width, int height)
bitmap[1] = new BBitmap( BRect( 0, 0, width, height ), colspace[colspace_index].colspace); bitmap[1] = new BBitmap( BRect( 0, 0, width, height ), colspace[colspace_index].colspace);
memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength()); memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength());
memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength()); memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength());
intf_Msg("Color index used: %i", colspace_index); intf_Msg("Color space: %s", colspace[colspace_index].name);
return drawingMode; return drawingMode;
} }
...@@ -575,8 +572,15 @@ static int BeosOpenDisplay( vout_thread_t *p_vout ) ...@@ -575,8 +572,15 @@ static int BeosOpenDisplay( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
static void BeosCloseDisplay( vout_thread_t *p_vout ) static void BeosCloseDisplay( vout_thread_t *p_vout )
{ {
VideoWindow * p_win = p_vout->p_sys->p_window;
/* Destroy the video window */ /* Destroy the video window */
delete p_vout->p_sys->p_window; if( p_win != NULL && !p_win->teardownwindow)
{
p_win->Lock();
p_win->teardownwindow = true;
p_win->Hide();
p_win->Quit();
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment