GNOME Bugzilla – Bug 565487
Glib::spawn_async* functions don't work with exceptions disabled
Last modified: 2008-12-24 22:11:42 UTC
notice: 73 void spawn_async_with_pipes(const std::string& working_directory, 74 const Glib::ArrayHandle<std::string>& argv, 75 const Glib::ArrayHandle<std::string>& envp, 76 SpawnFlags flags, 77 const sigc::slot<void>& child_setup, 78 Pid* child_pid, 79 int* standard_input, 80 int* standard_output, 81 int* standard_error) 82 { 83 const bool setup_slot = !child_setup.empty(); 84 sigc::slot<void> child_setup_ = child_setup; 85 GError* error = 0; 86 87 g_spawn_async_with_pipes( 88 working_directory.c_str(), 89 const_cast<char**>(argv.data()), 90 const_cast<char**>(envp.data()), 91 static_cast<GSpawnFlags>(unsigned(flags)), 92 (setup_slot) ? &child_setup_callback : 0, 93 (setup_slot) ? &child_setup_ : 0, 94 child_pid, 95 standard_input, standard_output, standard_error, 96 &error); 97 98 if(error) 99 Glib::Error::throw_exception(error); 100 } If glibmm is build with exceptions disabled, the Glib::Error::throw_exception() function simply returns a std::auto_ptr<> with the error, but we dont' do anything with it, we just let it go out of scope at the end of the function. So the user has no way of knowing that the function failed.
Created attachment 125284 [details] [review] spawn_no_exceptions.patch Yes. I committed this patch to fix it. It's what we do for other functions/methods that throw exceptions.