comparison src/input.cc @ 12259:40be4f07b3b5 release-3-4-x

input.cc (input_event_hook): fix incorrect use of iterator
author John W. Eaton <jwe@octave.org>
date Thu, 27 Jan 2011 04:26:39 -0500
parents 12df7854fa7c
children 11faa69c4eaa
comparison
equal deleted inserted replaced
12258:077ece977a7b 12259:40be4f07b3b5
1253 while (p != hook_fcn_map.end ()) 1253 while (p != hook_fcn_map.end ())
1254 { 1254 {
1255 std::string hook_fcn = p->first; 1255 std::string hook_fcn = p->first;
1256 octave_value user_data = p->second; 1256 octave_value user_data = p->second;
1257 1257
1258 p++; 1258 hook_fcn_map_type::iterator q = p++;
1259 1259
1260 if (is_valid_function (hook_fcn)) 1260 if (is_valid_function (hook_fcn))
1261 { 1261 {
1262 if (user_data.is_defined ()) 1262 if (user_data.is_defined ())
1263 feval (hook_fcn, user_data, 0); 1263 feval (hook_fcn, user_data, 0);
1264 else 1264 else
1265 feval (hook_fcn, octave_value_list (), 0); 1265 feval (hook_fcn, octave_value_list (), 0);
1266 } 1266 }
1267 else 1267 else
1268 hook_fcn_map.erase (p); 1268 hook_fcn_map.erase (q);
1269 } 1269 }
1270 1270
1271 if (hook_fcn_map.empty ()) 1271 if (hook_fcn_map.empty ())
1272 command_editor::remove_event_hook (input_event_hook); 1272 command_editor::remove_event_hook (input_event_hook);
1273 } 1273 }