changeset 35779:8ad72f9cf697

Fix segmentation fault with menu window. Check whether menu is present before calling menu's mouse handler.
author ib
date Fri, 25 Jan 2013 11:57:24 +0000
parents 8ba56e7c14fb
children 4073fff5efc7
files gui/ui/main.c gui/ui/playbar.c gui/ui/video.c
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/main.c	Fri Jan 25 11:51:37 2013 +0000
+++ b/gui/ui/main.c	Fri Jan 25 11:57:24 2013 +0000
@@ -189,7 +189,7 @@
                  wsWindowMove( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) );
                  break;
             case itPRMButton:
-                 guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
+                 if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
                  break;
             case itPotmeter:
                  item->value=(float)( X - item->x ) / item->width * 100.0f;
--- a/gui/ui/playbar.c	Fri Jan 25 11:51:37 2013 +0000
+++ b/gui/ui/playbar.c	Fri Jan 25 11:57:24 2013 +0000
@@ -211,7 +211,7 @@
 	switch ( itemtype )
 	 {
 	  case itPRMButton:
-	       guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
+	       if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
 	       break;
 	  case itPotmeter:
 	       item->value=(float)( X - item->x ) / item->width * 100.0f;
--- a/gui/ui/video.c	Fri Jan 25 11:51:37 2013 +0000
+++ b/gui/ui/video.c	Fri Jan 25 11:57:24 2013 +0000
@@ -89,7 +89,7 @@
                     }
                    break;
             case wsPMMouseButton:
-                   guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
+                   if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
                    break;
 	    default: uiPlaybarShow( Y ); break;
            }