Gtk::Main and Glib::OptionContext



The reference manual seems to suggest that the following makes sense:

  try { Gtk::Main application ( ac , av , context ) ; }
  catch ( Glib::OptionError e ) { std::cout << e.what ( ) << std::endl ;
return 1 ; }

however, this just causes a seg fault.  It I remove the try/catch it
works (but I get crap error message for unknown options).  I am almost
certainly doing something stupid but...

From gdb I get:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1229269312 (LWP 5871)]
0xb7bb8af6 in sigc::trackable::callback_list ()
from /usr/lib/libsigc-2.0.so.0
gdb>bt
#0  0xb7bb8af6 in sigc::trackable::callback_list ()
from /usr/lib/libsigc-2.0.so.0
#1  0xb7bb8b71 in sigc::trackable::add_destroy_notify_callback ()
from /usr/lib/libsigc-2.0.so.0
#2  0xb7e28a6e in
sigc::visit_each<sigc::internal::limit_derived_target<sigc::trackable*,
sigc::internal::slot_do_bind>, sigc::trackable> ()
   from /usr/lib/libgtkmm-2.4.so.1
#3  0xb7e28a9a in
sigc::visit_each<sigc::internal::limit_derived_target<sigc::trackable*,
sigc::internal::slot_do_bind>, Gtk::Main, true> ()
   from /usr/lib/libgtkmm-2.4.so.1
#4  0xb7e28ac7 in
sigc::visit_each<sigc::internal::limit_derived_target<sigc::trackable*,
sigc::internal::slot_do_bind>, void, Gtk::Main> ()
   from /usr/lib/libgtkmm-2.4.so.1
#5  0xb7e28af5 in
sigc::visit_each<sigc::internal::limit_derived_target<sigc::trackable*,
sigc::internal::slot_do_bind>, sigc::bound_mem_functor0<void, Gtk::Main>
> ()
   from /usr/lib/libgtkmm-2.4.so.1
#6  0xb7e28b28 in sigc::visit_each_type<sigc::trackable*,
sigc::internal::slot_do_bind,
sigc::adaptor_functor<sigc::bound_mem_functor0<void, Gtk::Main> > > ()
   from /usr/lib/libgtkmm-2.4.so.1
#7  0xb7e286c8 in Gtk::Main::run () from /usr/lib/libgtkmm-2.4.so.1
#8  0x08057a5a in FontBrowser::startUI ()
#9  0x08058305 in main ()
gdb>



-- 
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             russel russel org uk

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]