From e2ba8d91c059dfac89a89ca8f0dd81ab22b3ccba Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 6 Apr 2007 19:38:22 +0000 Subject: [PATCH] Added extra check to prevent calling frame() when the window has been closed. --- examples/osgkeyboardmouse/osgkeyboardmouse.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/osgkeyboardmouse/osgkeyboardmouse.cpp b/examples/osgkeyboardmouse/osgkeyboardmouse.cpp index e6971d74a..6c1be534e 100644 --- a/examples/osgkeyboardmouse/osgkeyboardmouse.cpp +++ b/examples/osgkeyboardmouse/osgkeyboardmouse.cpp @@ -391,10 +391,13 @@ int main( int argc, char **argv ) { gw->checkEvents(); - viewer.frame(); + if (gw->isRealized() && !exitHandler->done()) + { + viewer.frame(); - // Swap Buffers - gw->swapBuffers(); + // Swap Buffers + gw->swapBuffers(); + } } return 0;