diff options
author | Enrico Tassi <Enrico.Tassi@inria.fr> | 2014-04-10 16:09:22 +0200 |
---|---|---|
committer | Enrico Tassi <Enrico.Tassi@inria.fr> | 2014-04-10 19:43:07 +0200 |
commit | cbd7317516eaac4a5f37c896da5ea984ec1bb77a (patch) | |
tree | 39b5c58f9db3a2d47220f7586ac9af2cfce1d272 | |
parent | 4ec840d145927b0dd6ec1040a8a5ff573a0d7685 (diff) |
CoqIDE: removing a timer may raise an exception
-rw-r--r-- | ide/coq.ml | 2 | ||||
-rw-r--r-- | ide/ideutils.ml | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ide/coq.ml b/ide/coq.ml index 3dd2ce006..af00cc63c 100644 --- a/ide/coq.ml +++ b/ide/coq.ml @@ -196,7 +196,7 @@ module GlibMainLoop = struct type condition = Glib.Io.condition let add_watch ~callback chan = Glib.Io.add_watch ~cond:[`ERR; `HUP; `IN; `NVAL; `PRI] ~callback chan - let remove_watch = Glib.Io.remove + let remove_watch x = try Glib.Io.remove x with Glib.GError _ -> () let read_all = Ideutils.io_read_all let async_chan_of_file fd = Glib.Io.channel_of_descr fd let async_chan_of_socket s = !gio_channel_of_descr_socket s diff --git a/ide/ideutils.ml b/ide/ideutils.ml index 2ae46fc7e..d8ca34f98 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -130,7 +130,10 @@ let mktimer () = kill = (fun () -> match !timer with | None -> () - | Some id -> GMain.Timeout.remove id; timer := None) } + | Some id -> + (try GMain.Timeout.remove id + with Glib.GError _ -> ()); + timer := None) } let last_dir = ref "" |