aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ide/coq.ml2
-rw-r--r--ide/ideutils.ml5
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 ""