From 0b0fb9ad879840ae8be4194eee20b1a677a551c0 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 4 Feb 2010 13:05:25 -0600 Subject: [PATCH] Mixer: Don't die if user picks a submenu node in module context menu. --- mixer/src/Module.C | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mixer/src/Module.C b/mixer/src/Module.C index 332e359..2453684 100644 --- a/mixer/src/Module.C +++ b/mixer/src/Module.C @@ -399,6 +399,9 @@ Module::draw_label ( void ) void Module::insert_menu_cb ( const Fl_Menu_ *m ) { + if ( ! m->mvalue() || m->mvalue()->flags & FL_SUBMENU_POINTER || m->mvalue()->flags & FL_SUBMENU ) + return; + void * v = m->mvalue()->user_data(); if ( v ) @@ -465,6 +468,9 @@ Module::menu_cb ( const Fl_Menu_ *m ) { char picked[256]; + if ( ! m->mvalue() || m->mvalue()->flags & FL_SUBMENU_POINTER || m->mvalue()->flags & FL_SUBMENU ) + return; + strncpy( picked, m->mvalue()->label(), sizeof( picked ) ); // m->item_pathname( picked, sizeof( picked ) );