comparison src/load-path.cc @ 10066:2cd940306a06

make unwind_protect frames local
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 06 Jan 2010 13:18:41 +0100
parents 645c478aa89d
children cd96d29c5efa
comparison
equal deleted inserted replaced
10065:64a06079cae4 10066:2cd940306a06
560 { 560 {
561 std::list<std::string> elts = split_path (p); 561 std::list<std::string> elts = split_path (p);
562 562
563 // Temporarily disable add hook. 563 // Temporarily disable add hook.
564 564
565 unwind_protect::protect_var (add_hook); 565 unwind_protect frame;
566 frame.protect_var (add_hook);
566 567
567 add_hook = 0; 568 add_hook = 0;
568 569
569 do_clear (); 570 do_clear ();
570 571
572 i != elts.end (); 573 i != elts.end ();
573 i++) 574 i++)
574 do_append (*i, warn); 575 do_append (*i, warn);
575 576
576 // Restore add hook and execute for all newly added directories. 577 // Restore add hook and execute for all newly added directories.
577 578 frame.run_top ();
578 unwind_protect::run ();
579 579
580 for (dir_info_list_iterator i = dir_info_list.begin (); 580 for (dir_info_list_iterator i = dir_info_list.begin ();
581 i != dir_info_list.end (); 581 i != dir_info_list.end ();
582 i++) 582 i++)
583 { 583 {
1818 const std::string& script_file) 1818 const std::string& script_file)
1819 { 1819 {
1820 if (! octave_interpreter_ready) 1820 if (! octave_interpreter_ready)
1821 return; 1821 return;
1822 1822
1823 unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame (); 1823 unwind_protect frame;
1824 1824
1825 unwind_protect::protect_var (input_from_startup_file); 1825 frame.protect_var (input_from_startup_file);
1826 1826
1827 input_from_startup_file = true; 1827 input_from_startup_file = true;
1828 1828
1829 std::string file = file_ops::concat (dir, script_file); 1829 std::string file = file_ops::concat (dir, script_file);
1830 1830
1831 file_stat fs (file); 1831 file_stat fs (file);
1832 1832
1833 if (fs.exists ()) 1833 if (fs.exists ())
1834 source_file (file, "base"); 1834 source_file (file, "base");
1835
1836 unwind_protect::run_frame (uwp_frame);
1837 } 1835 }
1838 1836
1839 void 1837 void
1840 execute_pkg_add (const std::string& dir) 1838 execute_pkg_add (const std::string& dir)
1841 { 1839 {