From c3a87f75cd9620f59ea2a73a2739469e08d521ac Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 25 Jul 2013 01:14:23 +0200 Subject: [PATCH] Canvas GUI: check for window on handling mouse events. --- src/Canvas/gui_mgr.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Canvas/gui_mgr.cxx b/src/Canvas/gui_mgr.cxx index f3411d3bb..3188430e3 100644 --- a/src/Canvas/gui_mgr.cxx +++ b/src/Canvas/gui_mgr.cxx @@ -318,12 +318,12 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) assert(element->getUserData()); canvas::WindowPtr window = - boost::static_pointer_cast + boost::dynamic_pointer_cast ( static_cast(element->getUserData())->element ); - if( !window->isCapturingEvents() || !window->isVisible() ) + if( !window || !window->isCapturingEvents() || !window->isVisible() ) continue; float margin = window->isResizable() ? resize_margin_pos : 0; -- 2.39.5