RE : [Lablgtk] Segfault when removing or setting an invalid GTree.iter

"MONATE Benjamin 205998" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
Hi,

> But shouldn't LablGTK raise an exception when a GTree.iter invalid is going
> to be used?

First, Gtk does not give any warranty that a critical error will be emitted before accessing an invalid iterator.
Second, the message is tiggered in the middle of a C function of Gtk. No exception can be raised properly from this context without changing the source of Gtk itself. The same problem exists with callbacks raising exceptions.
You may want to play with 
Glib.Message.set_log_handler
  ~domain:"Gtk"
  ~levels:[ `CRITICAL] (fun ~level s -> prerr_endline s; exit 1);;
but any raised exception will be ignored.

Hope this helps,
Benjamin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.